I am using one laravel 5.7 authentication with custom check and session. I have 5 type of user types
Session::put('user_type', $user_type); Session::put('user_id', $user_id);
When I tried to check session data in constructor I am facing one issue,Please hele me to solve this,
ErrorException (E_NOTICE) Trying to get property 'headers' of non-object
public function __construct()
{
$this->middleware(function ($request, $next) {
$utype=Session::get('user_type');
if($utype != 'ProjectAdmin'){
return redirect()->route('login');
}else{
$this->objShareContract = shareContract::getShareContract(TRUE);
}
});
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire