/** * @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; }