S
S
styv2014-08-09 16:30:04
Laravel
styv, 2014-08-09 16:30:04

Grouping routes in Laravel?

Good afternoon.
There is a routing:

Route::group(['prefix' => 'admin'], function()
{
    $loginController = 'AdminAuthController';

    Route::get('login', [
        'as' => 'admin.login',
        'uses' => $loginController.'@login'
    ]);

    Route::post('login', [
        'uses' => $loginController.'@postLogin'
    ]);

    Route::get('logout', [
        'as' => 'admin.logout',
        'uses' => $loginController.'@logout'
    ]);

    Route::group(['before' => 'admin_auth'], function()
    {

        Route::get('users', ['as' => 'admin.users', function()
        {
            return 'users';
        }]);

        Route::get('/', ['as' => 'home', function()
        {
            return View::make('hello');
        }]);

    });

});

But the problem is that when I try to go to /admin it says that the page has a circular redirect. Although, in theory, this route should work:
Route::get('/', ['as' => 'home', function()
{
    return View::make('hello');
}]);

Tell me what's the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
styv, 2014-08-09
@styv

Damn, that's what I stepped on! Created a folder admin in public))))
Sorry for the stupid question!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question