vendredi 20 novembre 2015

Behaviour of routing in laravel

After trying out this acl tutorial I came across something I can't understand.

In laravel I created my route according to the tutorial and changed it to match laravel's auth controller (as I already used that before by installing it with bestmomo) to:

$router->get('/', [
    'uses' => 'Auth\AuthController@getLogin',
    'as' => 'admin.user.login',
    'middleware' => ['acl:login']
]);

Like this it doesn't find my route giving me the error

NotFoundHttpException in RouteCollection.php line 161:

If I add the following route:

Route::get('/login', [
'as' => 'login', 'uses' => 'Auth\AuthController@getRegister'
]);

It works well.

Why do I need to add the second route? Why can't the first one stand alone?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire