get(['users.*']); } /** * @param User $user * @param string $role * * @return bool */ public function attachRole(User $user, string $role): bool { $admin = Role::where('name', 'owner')->first(); $user->attachRole($admin); $user->save(); return true; } /** * @return int */ public function count(): int { return $this->all()->count(); } }