Answer the question
In order to leave comments, you need to log in
What is the complete sequence of actions to put a part of Laravel controllers in a separate folder?
Hello. I placed the MyController
controller in the /app/Http/Controllers/Admin
folder in the route, as in the manual:
Route::get('/admin/my', 'Admin\[email protected]');
ReflectionException (-1)
Class App\Http\Controllers\Admin\MyController does not exist
Answer the question
In order to leave comments, you need to log in
Solved the problem, maybe someone will come in handy.
If you just change the namespace in the controller itself,
then it starts writing this:
that is, it can't find the Controller base class, and we need to add one more line:
then it starts to see both our controller and the Controller base class, hooray!
Now I can shove controllers into separate folders in Laravel!))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question