I Create Restapi for my Joomla Site using lumen. I got Following Error in Lumen Route File.
lumen.ERROR: ReflectionException: Class App\Http\Controllers\App\Http\Controllers\CategoriesController does not exist in /var/www/j2mobapp/plugins/system/j2mobrest/api/vendor/illuminate/container/Container.php:749
My Route File Code :
$app->group(['prefix' => 'api/v2','namespace' => 'App\Http\Controllers'], function($app)
{
$app->get('appbanners/{id}', 'CategoriesController@getBannerImag');
});
What about deleting this from the group:
As it is a default. That's why you see it doubled.
So unless you put them in a custom folder in your
Controllerfolder, for exampleAdminthen you will need to add'namespace' => 'Admin'so each controller in the group will be prefixed asApp\Http\Controllers\AdminAlso make sure that in your
CategoriesControlleryou have the namespace correct at the top of the class which is: