-1
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

Mehravish Temkar
  • 4,275
  • 3
  • 25
  • 44
  • 2
    What version of php do you use? – u_mulder Sep 04 '18 at 07:47
  • Hi. Please put more lines (or the whole route file content) here. I think the main problem is before this line. – Rouhollah Mazarei Sep 04 '18 at 07:49
  • You might want to take a look at the [documentation](https://laravel.com/docs/5.6/routing#route-groups) – brombeer Sep 04 '18 at 07:49
  • Can you show a few lines before and a few lines after? – Jerodev Sep 04 '18 at 07:51
  • Please put whole code block till the closing brace of the 'function() {' – Ntwobike Sep 04 '18 at 07:52
  • it would help to post the whole `web.php` file. – Wreigh Sep 04 '18 at 07:57
  • Route::prefix('portfolio')->group(function () { Route::get('/',['uses'=>'PortfolioController@execute','as'=>'portfolio']); Route::match(['get','post'],'/add',['uses'=>'PortfolioAddController@execute','as'=>'portfolioAdd']); Route::match(['get','post','delete'],'/edit/(portfolio)',['uses'=>'PortfolioEditController@execute','as'=>'portfolioEdit]); }); – Arturo Hotsulyak Sep 04 '18 at 08:29

3 Answers3

0

change to this

Route::prefix('portfolio')->group(function () {

});
kenken9999
  • 765
  • 1
  • 6
  • 14
0

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.

brombeer
  • 8,716
  • 5
  • 21
  • 27
-2

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
});
Afraz Ahmad
  • 5,193
  • 28
  • 38