Skip to content
Advertisement

How to add custom field in default registration form of Laravel 5.6?

In one of my Laravel 5.6 applications, I need to add a few more fields in the default registration form.

So I’ve added only one field to test [phone_no] in the default registration form registration.blade.php, and also add phone_no RegisterController, but when I click on the register button it shows the following errors:

JavaScript

So here is the migration file code:

JavaScript

And here is the code of RegisterController:

JavaScript

So I think I am missing something. Can anyone tell me how can I add one/more fields in the Laravel 5.6 default registration form and save those field successfully…

  • Thanks

Advertisement

Answer

Please add your custom field in below way.

In your model add the your custom field in protected $fillable=['name', 'email', 'password', 'created_by', 'phone_no'] in your model

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement