app->singleton(CommentFilter::class, function (Application $app) { return new CommentFilter(); }); $this->app->singleton(CommentOrder::class, function (Application $app) { return new CommentOrder(); }); $this->app->singleton(PostCommentService::class, function (Application $app) { return new PostCommentService( $this->app->get(CommentFilter::class), $this->app->get(CommentOrder::class), ); }); } /** * Bootstrap services. */ public function boot(): void { // } }