P粉7998853112023-08-16 09:04:22
I just added the username in app.php and then it worked
protected $fillable = [ 'username', 'name', 'email', 'password', ];
P粉4733635272023-08-16 00:24:13
You can set the name
value to non-empty in the database (and migrations). If you also want to have the name
and username
attributes, there are two options:
Set a default value for the name
attribute (or make it nullable) and add the username
attribute using migrations in the database.
Create a name
field in the registration form and request validation, now you can add it to the database record.
Tip: In your model file (User.php
) you must add each property you want to fill to the $fillable
attribute:
protected $fillable = ['name', 'username', ...];