php - What is the best way to restrict any routes in Laravel 5.0? -


i want restrict routes of application , allow authenticated user.

i tried check using auth:check() function doesn't seem work.

// route restriction if (auth::check()){      //web directory     route::get('web-directory','webdirectorycontroller@index'); } 

when got mysite/web-directory still 404 error - if i'm log-in.

enter image description here

what best way restrict routes in laravel 5.0 ?

all right, figured out solution own question.

i restrict routes doing this

// route group $router->group(['middleware' => 'auth'], function() {      //web directory     route::get('web-directory','webdirectorycontroller@index'); } 

now, can go route fine, , 404 error kick in when user not yet log-in.

i hope someone.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -