title: Laravel set radio button is checked based on database value
body: <p>I need to show the radio button checked based on database value and update the value if i change the selection of radio button and showed on form.</p>
  
  <pre><code> &lt;label class="radio-inline"&gt;
                                  &lt;input type="radio"  id="option1" name="status" value="{{ old('is_active', $site-&gt;is_active) }}" name="status"  &gt;OFF&lt;/label&gt;
                                  &lt;label class="radio-inline"&gt;
                                  &lt;input type="radio" id="option2" name="status" value="{{ old('is_active', $site-&gt;is_active) }}" name="status"&gt;ON&lt;/label&gt;
  </code></pre>
  
  <p>this is inside my controller</p>
  
  <pre><code> $site-&gt;update([
              'name'=&gt;$request['name'],
              'copyright'=&gt; $request['copyright'],
              'is_active'=&gt;$request['status'] == 'true' ? 1 : 0,
              'message'=&gt;$request['message'],
              'datatime'=&gt;date('Y-m-d', strtotime($request['datatime'])),
              'url'=&gt;$request['url'],
              'metadata'=&gt;$request['metadata']
  
          ]);
  </code></pre>