Various API updates.

This commit is contained in:
James Cole
2018-12-03 07:18:05 +01:00
parent 0256337855
commit 050334a648
10 changed files with 212 additions and 39 deletions

View File

@@ -288,7 +288,7 @@ class UserRepository implements UserRepositoryInterface
*/
public function store(array $data): User
{
return User::create(
$user = User::create(
[
'blocked' => $data['blocked'] ?? false,
'blocked_code' => $data['blocked_code'] ?? null,
@@ -296,6 +296,12 @@ class UserRepository implements UserRepositoryInterface
'password' => str_random(24),
]
);
$role = $data['role'] ?? '';
if ('' !== $role) {
$this->attachRole($user, $role);
}
return $user;
}
/**