php - Laravel 5.3 keep going to /home view -


kindly me solve auth redirect issue.

currently i'm using laravel 5.3.22. put

protected $redirectto = 'dashboard'; 

into logincontroller.

then test redirect in browser:

http://myapp.localhost/login 

it shows "login page" correctly. continue login, redirect me "dashboard" correctly.

the issue here. after login, if tried go to

http://myapp.localhost/login 

it redirect me "home" not available. should go "dashboard".

please me.

please in folder /app/http/middleware/ there should see following file redirectifauthenticated.php

change from:

public function handle($request, closure $next, $guard = null)     {         if (auth::guard($guard)->check()) {             return redirect('/home');         }          return $next($request); 

to :

public function handle($request, closure $next, $guard = null)     {         if (auth::guard($guard)->check()) {             return redirect('/dashboard');         }          return $next($request); 

you should fine.

note,

/app/controllers/auth/logincontroller.php

directs sent after login, while

/app/middleware/redirectifauthenticated.php

controls user sent if domain.app/login request requested after loging in.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -