Код: Выделить всё
if (auth()->check() && (auth()->user()->hasRole('Admin'))) {
$people = Person::latest()->paginate(5);
} else {
$people = Person::where('user_id', $user->id)->latest()->paginate(5);
}
Условие 'if' работает правильно.
Подробнее здесь: https://stackoverflow.com/questions/760 ... phense1013
Мобильная версия