diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 9281aae..0b25cc9 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -44,12 +44,8 @@ class UserController extends Controller { 'name' => $creds['name'] ]); - $user->roles()->attach(Role::firstOrCreate([ - 'slug' => config('hydra.default_user_role_slug', 'user') - ],[ - 'name' => Str::title(config('hydra.default_user_role_slug', 'user')) - ])); - + $defaultRoleSlug = config('hydra.default_user_role_slug', 'user'); + $user->roles()->attach(Role::where('slug', $defaultRoleSlug)->first()); return $user; }