title: Laravel. Radio button request to controller. NULL VALUES GIVEN
body: <p>There are two radio buttons, either it is a 'yes' or a 'no'.</p>
  <p>When the user chooses 'no', I want the request sent to have the value set in the constant. The value I set in the constant when the user chooses no is 'Others'. When console log the input, it gives me the value = 'Others', but when i dd($request-&gt;All()) in the controller, it gives me null value.</p>
  <p>When the user chooses 'yes', a drop-down list appears so that the user can choose the profession from the 'profession' table. This is working well, because if the user chooses 'yes' in the radio button and chooses a profession from the drop-down list, when I dd($request-&gt;All()), it shows the value I want.</p>
  <p><strong>Index File</strong> to include the form file</p>
  <pre><code>            &lt;form action=&quot;{{ route('borrower.save_kyc_step_two') }}&quot; method=&quot;post&quot; class=&quot;card&quot;&gt;
                  @csrf
                  &lt;div class=&quot;card-header&quot;&gt;
                      &lt;h4 class=&quot;card-title&quot;&gt;{{ __('strings.details') }}&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;card-body&quot;&gt;
                      &lt;div class=&quot;row&quot;&gt;
                          &lt;div class=&quot;col-xl-12&quot;&gt;
                              @include('frontend.borrower.kyc.step2.forms._kyc2')
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;card-footer text-end&quot;&gt;
                      &lt;div class=&quot;d-flex&quot;&gt;
                          &lt;a href=&quot;{{ route('borrower.kyc_step_one') }}&quot; class=&quot;btn btn-link&quot;&gt;{{ __('strings.back') }}&lt;/a&gt;
                          &lt;label class=&quot;form-label mt-2 ms-2&quot;&gt;
                              {{ __('strings.increase_cc') }}
                          &lt;/label&gt;
                          &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary ms-auto&quot; style=&quot;height: 40px; line-height: 50%;&quot;&gt;
                              {{ __('strings.update&amp;next') }} &lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  <p><strong>frontend.borrower.kyc.step2.forms._kyc2 BLADE FILE</strong></p>
  <pre><code>@inject('constants', 'App\Helpers\Constant')
  &lt;div class=&quot;row mt-3&quot;&gt;
     &lt;div class=&quot;col-lg-4 col-md-4 col-sm-none&quot;&gt;
         &lt;label for=&quot;user_profession&quot; class=&quot;form-label required&quot;&gt;{{ __('strings.pro_body') }}&lt;/label&gt;
         &lt;div class=&quot;form-check mx-3&quot;&gt;
             &lt;input value=&quot;{{ $constants::IS_NOT_PROFESSIONAL }}&quot; class=&quot;form-check-input&quot; type=&quot;radio&quot;
                 name=&quot;user_profession&quot; onclick=&quot;findselected()&quot; @if (old('user_profession') ? old('user_profession') : $user-&gt;user_profession === 'No') checked @endif&gt;
             &lt;label class=&quot;form-check-label&quot; for=&quot;user_profession&quot;&gt; {{ __('strings.no') }} &lt;/label&gt;
         &lt;/div&gt;
         &lt;div class=&quot;form-check mx-3&quot;&gt;
             &lt;input id=&quot;yesCheck&quot; class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;user_profession&quot; onclick=&quot;findselected()&quot;
                 @if (old('user_profession') ? old('user_profession') : $user-&gt;user_profession === 'Yes') checked @endif&gt;
             &lt;label class=&quot;form-check-label&quot; for=&quot;user_profession&quot;&gt; {{ __('strings.yes') }} &lt;/label&gt;
         &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;row mt-3&quot;&gt;
     &lt;div class=&quot;col-lg-12 col-md-12 col-sm-none&quot; id=&quot;ifYes&quot; style=&quot;display:none&quot;&gt;
         &lt;label class=&quot;form-label&quot;&gt;{{ __('strings.yes_specify') }}&lt;/label&gt;
         &lt;select class=&quot;form-select&quot; name=&quot;user_profession&quot; id=&quot;inputtext&quot;&gt;
             @foreach ($professions as $profession)
                 &lt;option value=&quot;{{ $profession-&gt;name }}&quot;&gt;{{ $profession-&gt;name }}&lt;/option&gt;
             @endforeach
         &lt;/select&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>CONSTANT FILE</strong></p>
  <pre><code>const IS_NOT_PROFESSIONAL = 'Others';
  </code></pre>
  <p><strong>FUNCTION IN THE CONTROLLER</strong></p>
  <pre><code>public function save_kyc_step_two(Request $request)
      {
   
          $request-&gt;validate([
              'user_profession' =&gt; 'required|nullable'
          ]);
  
          // save into database 
          $user = $request-&gt;user();
          $user-&gt;user_profession = $request-&gt;user_profession;
  
          dd($request-&gt;All());
          [enter image description here][1]
          $user-&gt;save();
  
          session()-&gt;flash('alert-success', &quot;Identification Details Saved&quot;);
          return redirect()-&gt;route('borrower.kyc_step_three');
          // return back();
      }
  </code></pre>
  <p>Just to summarize, I want the null value to be 'Others' when the user chooses no in the radio button. Thank you</p>