title: How to use HTML/Bootstrap 4 checkbox, radio buttons and select field in laravel 8 blade template
body: <p>I'm working on a web app to register members online, I'm using Laravel 8 and Bootstrap 4, I'm a beginner in Laravel. The online form has text fields, a check box, radio buttons and a drop-down select field. I know how to work on blade template, controller and model to validate and post text field data into a MySQL database (see my sample code). But I'm not sure how checkbox, radio buttons and select field work in a blade template, in a controller and in the model. I would like all data in this form to be submitted together at once to a MySQL database.</p>
  <p>I have checked online for some help and I haven't found an answer especially for new Laravel version 8. Please help, thank you.</p>
  <hr />
  <p>Register Controller</p>
  <pre><code>class RegisterController extends Controller
  {
  
      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'],
              'email' =&gt; ['required', 'string', 'email', 'max:255', 'unique:users'],
              'password' =&gt; ['required', 'string', 'min:8', 'confirmed'],
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return \App\Models\User
       */
      protected function create(array $data)
      {
          return User::create([
              'name' =&gt; $data['name'],
              'email' =&gt; $data['email'],
              'password' =&gt; Hash::make($data['password']),
          ]);
      }
  }
  </code></pre>
  <hr />
  <p>User Model</p>
  <pre><code>class User extends Authenticatable
  {
      use HasFactory, Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name',
          'email',
          'password',
      ];
  
      /**
       * 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',
      ];
  }
  </code></pre>
  <hr />
  <p>Register Blade Template (Only a section of code)</p>
  <pre><code>&lt;form method=&quot;POST&quot; action=&quot;{{ route('register') }}&quot;&gt;
              @csrf
                  &lt;div class=&quot;form-group row&quot;&gt;
                      &lt;div class=&quot;col-sm-4&quot;&gt;
                          &lt;label for=&quot;surname&quot;&gt;{{ __('Surname') }}&lt;/label&gt;
                          &lt;input type=&quot;text&quot; class=&quot;form-control @error('surname') is-invalid @enderror&quot; id=&quot;surname&quot; placeholder=&quot;Surname&quot; name=&quot;surname&quot; value=&quot;{{ old('surname') }}&quot; required autocomplete=&quot;surname&quot;&gt;
                          @error('surname')
                                      &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 class=&quot;col-sm-4&quot;&gt;
                          &lt;label for=&quot;middle_name&quot;&gt;{{ __('Middle Name') }}&lt;/label&gt;
                          &lt;input type=&quot;text&quot; class=&quot;form-control @error('middle_name') is-invalid @enderror&quot; id=&quot;middle_name&quot; placeholder=&quot;Middle Name&quot; name=&quot;middle_name&quot; value=&quot;{{ old('middle_name') }}&quot; required autocomplete=&quot;middle_name&quot;&gt;
                          @error('middle_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 class=&quot;col-sm-2&quot;&gt;
                      &lt;label style=&quot;padding-right:5px;&quot;&gt;Gender&lt;/label&gt;
                          &lt;div class=&quot;form-check form-check-inline&quot;&gt;
                          &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;gender&quot; id=&quot;gender_male&quot; value=&quot;male&quot;&gt;
                          &lt;label class=&quot;form-check-label&quot; for=&quot;gender_male&quot;&gt;Male&lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      
                      &lt;div class=&quot;col-sm-2&quot;&gt;
                         &lt;div class=&quot;form-check form-check-inline&quot;&gt;
                          &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;gender&quot; id=&quot;gender_female&quot; value=&quot;female&quot;&gt;
                          &lt;label class=&quot;form-check-label&quot; for=&quot;gender_female&quot;&gt;Female&lt;/label&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt;              
                  &lt;/div&gt;
  
                  &lt;div class=&quot;col-sm-4&quot;&gt;
                  &lt;label class=&quot;mdb-main-label&quot;&gt;County&lt;/label&gt;
                      &lt;select class=&quot;custom-select&quot;&gt;
                            &lt;option selected&gt;Select County&lt;/option&gt;
                                  &lt;option value=&quot;mombasa&quot;&gt;001-Mombasa&lt;/option&gt;
                                  &lt;option value=&quot;kwale&quot;&gt;002-Kwale&lt;/option&gt;
                                  &lt;option value=&quot;kilifi&quot;&gt;003-Kilifi&lt;/option&gt;
                                  &lt;option value=&quot;tana_river&quot;&gt;004-Tana River&lt;/option&gt;
                                  &lt;option value=&quot;lamu&quot;&gt;005-Lamu&lt;/option&gt;
                                  &lt;/select&gt;
                            &lt;/div&gt;
  </code></pre>