|
|
@ -31,13 +31,17 @@ class RegisteredUserController extends Controller
|
|
|
|
public function store(Request $request): RedirectResponse
|
|
|
|
public function store(Request $request): RedirectResponse
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$request->validate([
|
|
|
|
$request->validate([
|
|
|
|
'name' => ['required', 'string', 'max:255'],
|
|
|
|
'firstname' => ['required', 'string', 'max:255'],
|
|
|
|
|
|
|
|
'lastname' => ['required', 'string', 'max:255'],
|
|
|
|
|
|
|
|
'username' => ['required', 'string', 'max:255'],
|
|
|
|
'email' => ['required', 'string', 'email', 'max:255', 'unique:'.User::class],
|
|
|
|
'email' => ['required', 'string', 'email', 'max:255', 'unique:'.User::class],
|
|
|
|
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
|
|
|
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$user = User::create([
|
|
|
|
$user = User::create([
|
|
|
|
'name' => $request->name,
|
|
|
|
'firstname' => $request->firstname,
|
|
|
|
|
|
|
|
'lastname' => $request->lastname,
|
|
|
|
|
|
|
|
'username' => $request->username,
|
|
|
|
'email' => $request->email,
|
|
|
|
'email' => $request->email,
|
|
|
|
'password' => Hash::make($request->password),
|
|
|
|
'password' => Hash::make($request->password),
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|