Skip to content

Commit 38148de

Browse files
committed
Register langgraph platform as a singleton
1 parent 6808e4e commit 38148de

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/LanggraphPlatformServiceProvider.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LangGraphPlatform;
46

57
use LangGraphPlatform\Commands\LangGraphPlatformCommand;
@@ -22,4 +24,22 @@ public function configurePackage(Package $package): void
2224
->hasMigration('create_langgraph_platform_php_table')
2325
->hasCommand(LangGraphPlatformCommand::class);
2426
}
27+
28+
public function registeringPackage(): void
29+
{
30+
// Register the main LangGraph Platform client as a singleton
31+
$this->app->singleton(LangGraphPlatform::class, function ($app) {
32+
return new LangGraphPlatform();
33+
});
34+
35+
// Bind the client to the container using the interface if needed
36+
$this->app->bind('langgraph-platform', function ($app) {
37+
return $app->make(LangGraphPlatform::class);
38+
});
39+
}
40+
41+
public function packageBooted(): void
42+
{
43+
// Additional setup can be done here if needed
44+
}
2545
}

0 commit comments

Comments
 (0)