0
votes

I am working on laravel project i have completed my admin panel and my all conrollers are in namespace App\Http\Controllers and everything is working perfectly fine now but i want to move all my Controller in folder AdminController for making everything more clear and smooth(Kind of HMVC technique).For this I add namespace on route which I did something like this

  Route::group(['prefix' =>'admin','namespace'=>'AdminController'], function ()
    {
/// all route
    });

and i move all my conrollers in folder AdminController.Now its giving me error Cannot redeclare class Chemist\Http\Controllers\RoleController

Note: My baseconroller are in director App\Http\Controllers and all other controller are in App\Http\Controllers\AdminController

1
Please post the full error message. Or just look at it, it should tell you also where exactly the class is already defined.Oliver Maksimovic

1 Answers

0
votes

Create custom controller dir like

php artisan make:controller subDriectory/YourController
php artisan make:controller subDriectory/YourController --plain