Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
- Go SDK: zero deps, functional options pattern, full endpoint coverage - PHP SDK: PHP 8.1+, curl-based, PdfOptions class, PSR-4 autoloading - Laravel package: ServiceProvider, Facade, config publishing - All SDKs document complete PDF options including new v0.4.5 params
34 lines
859 B
PHP
34 lines
859 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DocFast\Laravel;
|
|
|
|
use DocFast\Client;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class DocFastServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->mergeConfigFrom(__DIR__ . '/../config/docfast.php', 'docfast');
|
|
|
|
$this->app->singleton(Client::class, function ($app) {
|
|
$config = $app['config']['docfast'];
|
|
return new Client(
|
|
$config['api_key'] ?? '',
|
|
$config['base_url'] ?? 'https://docfast.dev',
|
|
$config['timeout'] ?? 60,
|
|
);
|
|
});
|
|
|
|
$this->app->alias(Client::class, 'docfast');
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->publishes([
|
|
__DIR__ . '/../config/docfast.php' => config_path('docfast.php'),
|
|
], 'docfast-config');
|
|
}
|
|
}
|