Update leenooks/laravel and framework updates

This commit is contained in:
Deon George
2022-06-28 21:57:55 +10:00
parent 3723d644e6
commit 464407e7ee
5 changed files with 97 additions and 110 deletions

View File

@@ -266,12 +266,12 @@ class User extends Authenticatable implements IDs
/**
* Determine if the user is an admin of the user with $id
*
* @param $id
* @param User|null $user
* @return bool
*/
public function isAdmin($id): bool
public function isAdmin(User $user=NULL): bool
{
return $id AND $this->isReseller() AND $this->accounts->pluck('user_id')->contains($id);
return $user->exists AND $this->isReseller() AND $this->accounts->pluck('user_id')->contains($user->id);
}
/**