Welcome Guest, Not a member yet? Register   Sign In
Redirect on a Controller contruct
#2

(This post was last modified: 12-19-2018, 06:21 AM by bvrignaud.)

PHP Code:
public function __construct() {
 
           
    $this
->ionAuth = new \App\Libraries\IonAuth();
 
           
    if
(!$this->loggedIn()){
        
var_dump('asdasd');
 
       return redirect()->to('/es/login');
    }


I don't think your "return" in a constructor will be effective.
Th only way I found, is to test "loggedIn" in each function.
Reply


Messages In This Thread
Redirect on a Controller contruct - by Perhood - 12-19-2018, 05:58 AM
RE: Redirect on a Controller contruct - by bvrignaud - 12-19-2018, 06:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB