public function getPermissions()
{
if (!Auth::guest()) {
// returns array
}
}
return null;
}
public function isMedStaff()
{
if (!Auth::guest()) {
// retuns true or false
}
return null;
}
On my local laragon these two methods work without any problem, but when i deploy them to my staging server, then some strange happens. The getPermissions() method retuns the permissions array as i want, but the isMedStaff() method return null. In both cases i am loggedin in my website. I dont understand, what the problem there is.
isMedStaff method will return null if the user is logged in.
Why don't you type it that way?
public function isMedStaff()
{
// Will return true if the user is logged in, false otherwise.
return !Auth::guest();
// Another way to achieve the same result.
return Auth::check();
}