Route::group(['prefix'=>'portfolio'],function() {
This is the line where I found my problem. what is bad here ?. I'm using laravel 5.6 and this is my directory …\routes\web.php39
Route::group(['prefix'=>'portfolio'],function() {
This is the line where I found my problem. what is bad here ?. I'm using laravel 5.6 and this is my directory …\routes\web.php39
According to the documentation your grouped routes should look like this:
Route::prefix('portfolio')->group(function () {
Route::get('users', function () {
// Matches The "/portfolio/users" URL
});
});
Replace the users
route with any route you want prefixed.
You are using wrong structure to add prefix:
Use below structure
Route::prefix('portfolio')->group(function() {
//your routes here
});
Laravel 5.5 has intrduced some methods like prefix
, middleware
, namespace
and name
etc so that we can chain features and requirements on routes.
You can chain them like below
Route::middleware(['auth', 'admin.auth'])
->namespace('Admin')
->prefix('admin')
->name('admin.')
->group(function() {
//your routes here
});