This commit is contained in:
James Cole
2018-08-28 21:48:10 +02:00
parent 4a8e3ee845
commit 5b771f7def
6 changed files with 161 additions and 16 deletions

View File

@@ -54,6 +54,7 @@ class UserRepository implements UserRepositoryInterface
{
$roleObject = Role::where('name', $role)->first();
if (null === $roleObject) {
Log::error(sprintf('Could not find role "%s" in attachRole()', $role));
return false;
}
@@ -61,7 +62,7 @@ class UserRepository implements UserRepositoryInterface
$user->roles()->attach($roleObject);
} catch (QueryException $e) {
// don't care
Log::info(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
Log::error(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
}
return true;
@@ -77,6 +78,7 @@ class UserRepository implements UserRepositoryInterface
* @see updateEmail
*
* @return bool
* @throws \Exception
*/
public function changeEmail(User $user, string $newEmail): bool
{