app->singleton(CategoryFilter::class, function (Application $app) { return new CategoryFilter(); }); $this->app->singleton(CategoryOrder::class, function (Application $app) { return new CategoryOrder(); }); $this->app->singleton(CategoryServiceInterface::class, function (Application $app) { return new CategoryService( $this->app->get(CategoryFilter::class), $this->app->get(CategoryOrder::class), ); }); } /** * Bootstrap services. */ public function boot(): void { // } }