Skip to content

Commit

Permalink
assign role to user
Browse files Browse the repository at this point in the history
  • Loading branch information
AmonDeShir committed Jan 7, 2025
1 parent 19506f5 commit eed2b8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/RegisterUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function store(RegisterUserRequest $request): RedirectResponse
$user = new User($request->validated());
$user->password = Hash::make($request->password);
$user->save();
$user->syncRoles("user");

event(new Registered($user));
Auth::login($user);
}
Expand Down

0 comments on commit eed2b8a

Please sign in to comment.