Hello, As far as I can see - you have wrong namespace. In order to get a controller from your \Api\V1 folder use group setting of namespace in such way:
Route::group(['domain' => 'api.medifaktor.de', 'namespace' => 'Api], function() {
Route::group(['prefix' => 'v1', 'namespace' => 'v1'], function() {
Route::get('incidents', array('as' => 'incidents', 'uses' => 'ApiIncidentsController@index'));
Route::get('incidents/{id}', array('as' => 'showIncidents', 'uses' => 'IncidentsController@show'));
});
});
This should work because you will tell Laravel to go into Api folder with first group and then to go into v1 with second group. Unless you are having more controllers in different directories - this is your solution. Otherwise please be aware that you need to type \Api\V1\YourController as your controller name.
Just don't forget that if you try to use a controller which is not in the specified group folder - you will get an error. In that case please use namespace on the required route.
Glad that I helped!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community