Default Role Slug Fix for New Users

pull/19/head
Hasin Hayder 2 years ago
parent 82aa3bba81
commit 3e16cee24f

@ -44,12 +44,8 @@ class UserController extends Controller {
'name' => $creds['name'] 'name' => $creds['name']
]); ]);
$user->roles()->attach(Role::firstOrCreate([ $defaultRoleSlug = config('hydra.default_user_role_slug', 'user');
'slug' => config('hydra.default_user_role_slug', 'user') $user->roles()->attach(Role::where('slug', $defaultRoleSlug)->first());
],[
'name' => Str::title(config('hydra.default_user_role_slug', 'user'))
]));
return $user; return $user;
} }

Loading…
Cancel
Save