first commit
This commit is contained in:
28
app/Providers/SettingsServiceProvider.php
Normal file
28
app/Providers/SettingsServiceProvider.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use App\Services\SettingsProviderService;
|
||||
use App\Contracts\SettingsProvider;
|
||||
|
||||
class SettingsServiceProvider extends ServiceProvider implements DeferrableProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(
|
||||
SettingsProvider::class,
|
||||
SettingsProviderService::class
|
||||
);
|
||||
|
||||
$this->app->bind('settings', function () {
|
||||
return $this->app->makeWith(SettingsProvider::class, ['saveScope' => false]);
|
||||
});
|
||||
}
|
||||
|
||||
public function provides(): array
|
||||
{
|
||||
return [SettingsProvider::class, 'settings'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user