namespace app\Providers\DomainRouter; use App\Models\Domains\Domain; use Illuminate\Support\ServiceProvider; use App\Services\DomainRouter\DomainRouter; class DomainRouterServiceProvider extends ServiceProvider { protected $defer = true; /** * Bootstrap the application services. * * @return void */ public function boot() { // } /** * Register the application services. * * @return void */ public function register() { $this->app->singleton(\App\Services\DomainRouter\DomainRouterInterface::class, function ($app) { return new DomainRouter(new Domain(), ['url' => $app['domainUrl']]); }); } public function provides() { return [\App\Services\DomainRouter\DomainRouterInterface::class]; } }