User guard for null

This commit is contained in:
Nabeel Shahzad 2021-04-23 13:47:54 -04:00
parent 14d0e99a37
commit ec6cb42bfd

View File

@ -72,6 +72,10 @@ class UserService extends Service
->with(['airline', 'bids', 'rank'])
->find($user_id);
if (empty($user)) {
return null;
}
if ($user->state === UserState::DELETED) {
return null;
}