diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 5313f35..d4ceb07 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -31,13 +31,17 @@ class RegisteredUserController extends Controller public function store(Request $request): RedirectResponse { $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], 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); $user = User::create([ - 'name' => $request->name, + 'firstname' => $request->firstname, + 'lastname' => $request->lastname, + 'username' => $request->username, 'email' => $request->email, 'password' => Hash::make($request->password), ]); diff --git a/app/Models/User.php b/app/Models/User.php index 23b4063..0ed62d8 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -18,7 +18,9 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'name', + 'firstname', + 'lastname', + 'username', 'email', 'password', ];