There is a background base class controller here, which determines whether the user is logged in, and then jumps to the specified method if not logged in, but the sentence inside "return Redirect: :to('admin\login@login')" doesn't work. The page always jumps to the home page after logging in. Instead of going to the login page.
Who can explain it to me and point out the error.
Use:
It really doesn’t work. At that time, I encountered the same problem as the original poster. Since it was urgent at the time, I didn’t go into details. Personally, I feel that since it is a parent class, it seems that Redirect cannot jump.
Follow.
Modified on May 30, 2016. After looking at it, my solution at that time was to use Laravel’s built-in auth middleware
You can directly use
redirect
Jumproute("admin\loginController@index")
It is recommended that LZ try to change return to echo. For constructors, return does not receive objects and generally has no effect.
That’s it.
Here is a detailed explanation.
http://stackoverflow.com/questions/27568147/laravel-constructor-redirect-is-not-working