Init
This commit is contained in:
24
app/Providers/AppServiceProvider.php
Normal file
24
app/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
29
app/Providers/TemporalServiceProvider.php
Normal file
29
app/Providers/TemporalServiceProvider.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Temporal\Client\GRPC\ServiceClient;
|
||||
use Temporal\Client\WorkflowClient;
|
||||
use Temporal\Client\WorkflowClientInterface;
|
||||
|
||||
class TemporalServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton(WorkflowClientInterface::class, function () {
|
||||
return WorkflowClient::create(
|
||||
ServiceClient::create(config('temporal.address'))
|
||||
);
|
||||
});
|
||||
|
||||
$this->app->alias(WorkflowClientInterface::class, WorkflowClient::class);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../../config/temporal.php' => config_path('temporal.php'),
|
||||
], 'temporal-config');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user