title: laravel 7 adding radio in register form
body: <p>i want to add radio in register form. For when someone want to register he need to choice if its man or woman and when i try to register its not work dont save in database <br>
  Someone can helping me add the radio for choice man or woman.</p>
  <p>create user table :</p>
  <pre>
  use Illuminate\Database\Migrations\Migration;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Support\Facades\Schema;
  
  class CreateUsersTable extends Migration
  {
     /**
      * Run the migrations.
      *
      * @return void
      */
     public function up()
     {
         Schema::create('users', function (Blueprint $table) {
             $table-&gt;id();
             $table-&gt;string('firstname');
             $table-&gt;string('email')-&gt;unique();
             $table-&gt;timestamp('email_verified_at')-&gt;nullable();
             $table-&gt;string('password');
             $table-&gt;string('name');
             $table-&gt;date('created_at');
             $table-&gt;string('address');
             $table-&gt;string('city');
             $table-&gt;string('zipcode');
             $table-&gt;string('gender');
             $table-&gt;string('number')-&gt;unique();
             $table-&gt;date('birthday');
             $table-&gt;string('pseudo')-&gt;unique();
             $table-&gt;rememberToken();
         });
     }
  
     /**
      * Reverse the migrations.
      *
      * @return void
      */
     public function down()
     {
         Schema::dropIfExists('users');
         $table-&gt;dropColumn('gender');
     }
  }
  
  </pre>
  <p>user.php</p>
  <pre>
  namespace App;
  
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Illuminate\Notifications\Notifiable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'birthday', 'email', 'password', 'firstname', 'address', 'city', 'zipcode', 'gender', 'number', 'pseudo',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      /**
       * The attributes that should be cast to native types.
       *
       * @var array
       */
      protected $casts = [
          'email_verified_at' =&gt; 'datetime',
      ];
  }
  
  </pre>
  <p>Register controller :</p>
  <pre>
  namespace App\Http\Controllers\Auth;
  
  use App\Http\Controllers\Controller;
  use App\Providers\RouteServiceProvider;
  use App\User;
  use Illuminate\Foundation\Auth\RegistersUsers;
  use Illuminate\Support\Facades\Hash;
  use Illuminate\Support\Facades\Validator;
  
  class RegisterController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Register Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users as well as their
      | validation and creation. By default this controller uses a trait to
      | provide this functionality without requiring any additional code.
      |
      */
  
      use RegistersUsers;
  
      /**
       * Where to redirect users after registration.
       *
       * @var string
       */
      protected $redirectTo = RouteServiceProvider::HOME;
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'name' =&gt; ['required', 'string', 'max:255'],
              'firstname' =&gt; ['required', 'string', 'max:255'],
              'address' =&gt; ['required', 'string', 'min:8'],
              'city' =&gt; ['required', 'string', 'min:8'],
              'zipcode' =&gt; ['required', 'string', 'min:2'],
              'email' =&gt; ['required', 'string', 'email', 'max:255', 'unique:users'],
              'birthday' =&gt; ['required', 'date_format:Y-m-d', 'before:today'],
              'password' =&gt; ['required', 'string', 'min:8', 'confirmed'],
              'pseudo' =&gt; ['required', 'string', 'min:8', 'unique:users'],
              'number' =&gt; ['required', 'string', 'min:8', 'unique:users'],
              'gender' =&gt; ['required', 'string'],
  
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return \App\User
       */
      protected function create(array $data)
      {
          return User::create([
              'name' =&gt; $data['name'],
              'firstname' =&gt; $data['firstname'],
              'address' =&gt; $data['address'],
              'zipcode' =&gt; $data['zipcode'],
              'email' =&gt; $data['email'],
              'birthday' =&gt; $data['birthday'],
              'city' =&gt; $data['city'],
              'number' =&gt; $data['number'],
              'gender' =&gt; $data['gender'],
              'pseudo' =&gt; $data['pseudo'],
  
              'password' =&gt; Hash::make($data['password']),
          ]);
      }
  }
  
  </pre>
  <p>register blade php</p>
  <pre><code>@extends('layouts.app')
  
  @section('content')
  &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row justify-content-center&quot;&gt;
          &lt;div class=&quot;col-md-8&quot;&gt;
              &lt;div class=&quot;card&quot;&gt;
                  &lt;div class=&quot;card-header&quot;&gt;{{ __('Register') }}&lt;/div&gt;
  
                  &lt;div class=&quot;card-body&quot;&gt;
                      &lt;form method=&quot;POST&quot; action=&quot;{{ route('register') }}&quot;&gt;
                          @csrf
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;email&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('E-Mail Address') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;email&quot; type=&quot;email&quot; class=&quot;form-control @error('email') is-invalid @enderror&quot; name=&quot;email&quot; value=&quot;{{ old('email') }}&quot; required autocomplete=&quot;email&quot;&gt;
  
                                  @error('email')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;password&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('Password') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;password&quot; type=&quot;password&quot; class=&quot;form-control @error('password') is-invalid @enderror&quot; name=&quot;password&quot; required autocomplete=&quot;new-password&quot;&gt;
  
                                  @error('password')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;password-confirm&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('Confirm Password') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;password-confirm&quot; type=&quot;password&quot; class=&quot;form-control&quot; name=&quot;password_confirmation&quot; required autocomplete=&quot;new-password&quot;&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;name&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('Name') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;name&quot; type=&quot;text&quot; class=&quot;form-control @error('name') is-invalid @enderror&quot; name=&quot;name&quot; value=&quot;{{ old('name') }}&quot; required autocomplete=&quot;name&quot; autofocus&gt;
  
                                  @error('name')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;firstname&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('Firstname') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;firstname&quot; type=&quot;text&quot; class=&quot;form-control @error('firstname') is-invalid @enderror&quot; name=&quot;firstname&quot; value=&quot;{{ old('firstname') }}&quot; required autocomplete=&quot;firstname&quot; autofocus&gt;
  
                                  @error('firstname')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;address&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('address') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;address&quot; type=&quot;text&quot; class=&quot;form-control @error('address') is-invalid @enderror&quot; name=&quot;address&quot; value=&quot;{{ old('address') }}&quot; required autocomplete=&quot;address&quot; autofocus&gt;
  
                                  @error('address')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;city&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('city') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;city&quot; type=&quot;text&quot; class=&quot;form-control @error('city') is-invalid @enderror&quot; name=&quot;city&quot; value=&quot;{{ old('city') }}&quot; required autocomplete=&quot;city&quot; autofocus&gt;
  
                                  @error('city')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;zipcode&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('zipcode') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;zipcode&quot; type=&quot;text&quot; class=&quot;form-control @error('zipcode') is-invalid @enderror&quot; name=&quot;zipcode&quot; value=&quot;{{ old('zipcode') }}&quot; required autocomplete=&quot;zipcode&quot; autofocus&gt;
  
                                  @error('zipcode')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;number&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('number') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;number&quot; type=&quot;text&quot; class=&quot;form-control @error('number') is-invalid @enderror&quot; name=&quot;number&quot; value=&quot;{{ old('number') }}&quot; required autocomplete=&quot;number&quot; autofocus&gt;
  
                                  @error('number')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;label for=&quot;birthday&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('birthday') }}&lt;/label&gt;
  
                              &lt;div class=&quot;col-md-6&quot;&gt;
                                  &lt;input id=&quot;birthday&quot; type=&quot;date&quot; class=&quot;form-control @error('birthday') is-invalid @enderror&quot; name=&quot;birthday&quot; value=&quot;{{ old('birthday') }}&quot; required autocomplete=&quot;birthday&quot; autofocus&gt;
  
                                  @error('birthday')
                                  &lt;span class=&quot;invalid-feedback&quot; role=&quot;alert&quot;&gt;
                                      &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @enderror
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div id=&quot;gender-group&quot; class=&quot;form-group{{ $errors-&gt;has('gender') ? ' has-error' : '' }}&quot;&gt;
                                  &lt;label for=&quot;gender&quot; class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;{{ __('Gender') }}&lt;/label&gt;
  
                                  &lt;div class=&quot;col-md-6&quot;&gt;
                                      &lt;div&gt;&lt;input id=&quot;female&quot; type=&quot;radio&quot; class=&quot;form-control&quot; name=&quot;gender&quot; value=&quot;Female&quot;&gt; {{ (old('sex') == 'female') ? 'checked' : '' }} &gt;Female&lt;/div&gt;
                                      &lt;div&gt;&lt;input id=&quot;male&quot; type=&quot;radio&quot; class=&quot;form-control&quot; name=&quot;gender&quot; value=&quot;Male&quot;&gt; {{ (old('sex') == 'male') ? 'checked' : '' }} &gt;Male&lt;/div&gt;
                                      @error('gender')
                                      &lt;span class=&quot;help-block&quot;&gt;
                                          &lt;strong&gt;{{ $message }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                      @enderror
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row mb-0&quot;&gt;
                              &lt;div class=&quot;col-md-6 offset-md-4&quot;&gt;
                                  &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;
                                      {{ __('Register') }}
                                  &lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>
  <p>Someone can talk where is my error ?</p>