update project
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContextFactory;
|
||||
use App\Domain\SchoolCore\Context\SchoolContextResolver;
|
||||
use App\Domain\SchoolCore\Context\SchoolContextStore;
|
||||
use App\Domain\SchoolCore\Context\SchoolContextValidator;
|
||||
use App\Http\Middleware\ResolveSchoolContext;
|
||||
use Illuminate\Contracts\Http\Kernel;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
final class SchoolContextServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->mergeConfigFrom(__DIR__ . '/../../config/school_context.php', 'school_context');
|
||||
|
||||
$this->app->singleton(SchoolContextStore::class);
|
||||
$this->app->bind(SchoolContextFactory::class);
|
||||
$this->app->bind(SchoolContextResolver::class);
|
||||
$this->app->bind(SchoolContextValidator::class);
|
||||
}
|
||||
|
||||
public function boot(Kernel $kernel): void
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../../config/school_context.php' => config_path('school_context.php'),
|
||||
], 'school-context-config');
|
||||
|
||||
// Laravel 10/older: also register alias in app/Http/Kernel.php if preferred.
|
||||
app('router')->aliasMiddleware('school.context', ResolveSchoolContext::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user