Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manshu's avatar
Level 28

Separating User Panel from Admin Panel

How do i separate usercontroller and admin controller.

User goes to Quiz panel.

Admin goes to Admin panel

Also in admin panel, i need CRUD for users in admin panel

Route::get('/', function () {
    return view('quiz');
});

Route::group(['as' => 'admin::','middleware' => 'auth'], function () {
    Route::get('dashboard', ['as' => 'dashboard', function () {
        return view('pages.index');
    }]);
    Route::resource('admin', 'adminController');
    Route::resource('user', 'userController');
});
0 likes
3 replies
coder's avatar

just create a folder in Controllers directory and put all the admin controllers into that and Laravel will auto load them for you.

manshu's avatar
Level 28

Question to my problem is, to separate both user and admin. User should not be able to login (admin panel )

Please or to participate in this conversation.