app->when(StudentController::class) ->needs(ServiceInterface::class) ->give(function () { return new StudentService(); }); $this->app->when(TeacherController::class) ->needs(ServiceInterface::class) ->give(function () { return new TeacherService(); }); $this->app->when(GradeController::class) ->needs(ServiceInterface::class) ->give(function () { return new GradeService(); }); $this->app->when(SubjectController::class) ->needs(ServiceInterface::class) ->give(function () { return new SubjectService(); }); $this->app->when(SubjectTeacherController::class) ->needs(ServiceInterface::class) ->give(function () { return new SubjectTeacherService(); }); $this->app->when(GradeSubjectController::class) ->needs(ServiceInterface::class) ->give(function () { return new GradeSubjectService(); }); } /** * Bootstrap services. */ public function boot(): void { // } }