Group route does not work in Laravel 5

-2
Good evening guys, how are you? I have a problem with Laravel 5 routes. I have a group of routes for the administrative panel of the site (routes with prefix panel) and inside the group I want the first page to be exactly in the "root". See the code below:

Route::group(['prefix' => 'painel', 'namespace' => 'Backend'], function(){

    // Login Routes
    Route::get('/', 'LoginController@getLogin');
]);

That way when 'localhost / panel' access does not open, 404 appears. If I put it like this:

Route::group(['prefix' => 'painel', 'namespace' => 'Backend'], function(){

    // Login Routes
    Route::get('/teste', 'LoginController@getLogin');
]);

and access 'localhost / panel / test' works. I want this route to work when only accessing 'localhost / panel'. Does anyone know what I'm doing wrong?

Thank you!

    
asked by anonymous 16.05.2015 / 00:45

2 answers

-1

Have you tried to create the 'panel / outside' route?

I believe this will work:)

 Route::get('/painel', 'LoginController@getLogin');

It should be before the group in the route file.

    
16.07.2015 / 14:37
-1

You have missed the default route inside the group, keep both.

// Rota Default
Route::get('/', 'LoginController@getLogin');

// Login Routes
Route::get('/teste', 'LoginController@getLogin');
    
02.01.2016 / 21:37