In this video we are going to learn about Add User Option and Phone On Register Page
So let see how can we Add User Option and Phone On Register Page
First of all lets create a migration for adding new column to the user model
So switch to the command prompt
And type the command

php artisan make:migration add_phone_to_users_table --table=users

Now switch to project and lets open the migration
So go inside the database directory then migration
Now from here open add_phone_to_users_table migration
Now add here new column

public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('phone')->nullable();
});
}

Now save this and lets migration this migration So switch to the command prompt and type the command

Php artisan migrate

Now lets run the application
Now Switch to the project and lets open register.blade.php file
So go inside the resources directory then view auth and from here lets open register.blade.php file
Now here lets add text field for phone and select control for Register user as

<div class=\"form-group row\">
<label for=\"phone\" class=\"col-md-4 col-form-label text-md-right\">Phone</label>
<div class=\"col-md-6\">
<input id=\"phone\" type=\"text\" class=\"form-control\" name=\"phone\" value=\"\" required=\"\">
</div>
</div>

<div class=\"form-group row\">
<label for=\"email\" class=\"col-md-4 col-form-label text-md-right\">Register As</label>
<div class=\"col-md-6\">
<select class=\"form-control\" name=\"registeras\" id=\"registeras\">
<option value=\"CST\">Customer</option>
<option value=\"SVP\">Service Provider</option>
</select>
</div>
</div>


Now lets open the User model
So go inside the app directory then models and from here lets open User.php file now
Inside the fillable add here utype and phone

protected $fillable = [
'name',
'email',
'password',
'phone',
'utype'
];

Now go inside the app->Action->Fortify
And from here lets open CreateNewUser.php file and modify the create method

public function create(array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'phone' => ['required'],
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['required', 'accepted'] : '',
])->validate();

$registeras = $input['registeras'] === 'SVP' ? 'SVP':'CST';

return User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
'phone' => $input['phone'],
'utype'=>$registeras
]);
}

Now all done so lets check it
So switch to the browser and refresh the page
Now register new user
So enter the name here,
Email, password, phone and select user type service provider
Now click on submit you can see user register successfully
Now lets register another user as customer
So enter another name and all details this select customer
Now click on submit you can see this time user created as customer
So in this way you can Add User Option and Phone On Register Page