roles()->attach($role); return $user; } public function update($userId, array $newDetails) { return User::whereId($userId)->update($newDetails); } }