I have been struggling with this issue for the pas hour and I'm not sure what have I done wrong. So the case is like this. I wanted to create a controller folder go group different controllers into their groups. By default laravel projects created a controller folder structure like this
Http
--Controller
----Auth
So what I would like to do is to make something like this
Http
--Controller
----Auth
----Folder_a
----Folder_b
----Folder_c
After making my folders, the controllers in my folders are also properly namespaced like so
<?php namespace App\Http\Controllers\Folder_a;
/*
|--------------------------------------------------------------------------
| Use the main controller to allow extend to the main controller
|--------------------------------------------------------------------------
*/
use App\Http\Controllers\Controller;
class SomethingController extends Controller {
/* Do something here*/
}
And finally in my routes.php i call the actions like such
Route::get('/action1/', array('as' => 'action1', 'uses' => 'SomethingController@action1'));
But some how when i try to navigate to that site it gives me this error
ReflectionException in compiled.php line 1029:
Class App\Http\Controllers\SomethingController does not exist
Noticed that it still go into the default folder App\Http\Controllers\ to find the controller but if I do like this
Route::get('/action1/', array('as' => 'action1', 'uses' => 'Folder_a\SomethingController@action1'));
Then everything will be fine... What have I done wrong in this case? also i have tried composer dump-autoload, nothing has changed.