35 lines
761 B
PHP
35 lines
761 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\InsForge\InsForgeClient;
|
|
use Illuminate\Contracts\Foundation\Application;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(InsForgeClient::class, function (Application $app) {
|
|
$config = $app->make('config')->get('insforge');
|
|
|
|
return new InsForgeClient(
|
|
$config['base_url'],
|
|
$config['api_key'],
|
|
$config['timeout'],
|
|
);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|