Laravel generate the routes using Route::resource need to add prefix /admin/ Laravel generate the routes using Route::resource need to add prefix /admin/ laravel laravel

Laravel generate the routes using Route::resource need to add prefix /admin/


If you need prefix for a multiple routes, you should use route group:

Route::group(['prefix' => 'admin'], function(){    Route::resource('books','Admin\BookController');});

Or, if you need to use just one controller, you could just do this:

Route::resource('/admin/books','Admin\BookController');


Change your route to

Route::resource('admin/books','Admin\BookController');


Just to add to Alexey's Answer. I'm using Namespace too with group. Below is the example.

Route::group([    'prefix'     => 'admin',    'namespace'  => 'Admin',    'middleware' => 'admin.routeNeedsPermission:view-admin-management',], function() {        Route::resource('books','BookController');});

By that way you don't need to write admin in all your routes.