1

Newbie here. I'm trying to use a prefix for the first time.

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

    Auth::routes();

    Route::get('/home', 'HomeController@index');



Route::group(['prefix' => 'admin','middleware' => ['admin']], function(){
  Route::get('/users', 'AdminUserController@index');
  Route::get('/users/create', 'AdminUserController@create');
  Route::get('/users/{id}', 'AdminUserController@store');
  Route::get('/users/profile', function());


 });

I keep getting this error:

[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected ';'

I've commented out all the route get and still get the error

il_raffa
  • 5,090
  • 129
  • 31
  • 36
Jeff Winkler
  • 137
  • 1
  • 4
  • 13

3 Answers3

1

You are missing a closed brace Change

 Route::get('/users/profile', function());

To

 Route::get('/users/profile', function({}));});
Forbs
  • 1,256
  • 1
  • 7
  • 9
0

Route::group(); Your sinppet don't have );

yunpengliu
  • 36
  • 4
0

I was missing the {}:

Route::get('/users/profile', function());

Route::get('/users/profile', function(){});

Jeff Winkler
  • 137
  • 1
  • 4
  • 13