if (auth()->check() && (auth()->user()->hasRole('Admin'))) {
$people = Person::latest()->paginate(5);
} else {
$people = Person::where('user_id', $user->id)->latest()->paginate(5);
}
My editor code analysis tool is not able to detect the method.Undefined method 'hasRole'.intelephense(1013)
The 'if' condition is working correctly.