title: updating/Changing the value using button in Laravel
body: <p>I was trying to update/change the <code>currentStatus</code> of a row from <code>0</code> to <code>1</code> using the <code>Approve</code> button in the datatable, but I have no idea how to do it. Can anyone please help me?</p>
  
  <p><a href="https://i.stack.imgur.com/uvA7i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uvA7i.png" alt="enter image description here"></a></p>
  
  <p>This is how I store</p>
  
  <pre><code>    public function store(Request $request){
          $currentStatus = 0;
  
          $data = $request-&gt;validate([
              'to' =&gt; 'required',
              'date' =&gt; 'date',
              'address' =&gt; 'required',
              'reference' =&gt; 'required',
              'attention' =&gt; 'required',
              'area' =&gt; 'required',
              'project' =&gt; 'required',
              'salesman' =&gt; 'required',
              'location' =&gt; 'required'
  
  
          ]);
          \App\Contract::create($data + ['status' =&gt; $currentStatus]);
          return redirect('contracts/pendings');
      }
  
  </code></pre>
  
  <p>This is how I display in the datatables</p>
  
  <pre><code>                &lt;table id="example1" class="table table-bordered table-striped"&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Customers Name&lt;/th&gt;
                              &lt;th&gt;Date Created&lt;/th&gt;
                              &lt;th&gt;Project Name&lt;/th&gt;
                              &lt;th&gt;Actions&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          &lt;tr&gt;
                              @forelse($pendingContracts as $pendingContract)
                              &lt;td&gt;{{$pendingContract-&gt;to}}&lt;/td&gt;
                              &lt;td&gt;{{$pendingContract-&gt;date}}&lt;/td&gt;
                              &lt;td&gt;{{$pendingContract-&gt;project}}&lt;/td&gt;
                              &lt;td&gt;
                                  &lt;button type="button" class="btn btn-info"&gt; 
                                      &lt;a href="/contracts/pendings/{{$pendingContract-&gt;id}}" style="color: #ffffff;"&gt;View Details&lt;/a&gt; 
                                  &lt;/button&gt;
                                  &lt;button type="button" class="btn btn-success"&gt; 
                                      &lt;a href="" style="color: #ffffff;"&gt;Approve&lt;/a&gt; 
                                  &lt;/button&gt;
  
                              &lt;/td&gt;
  
                          &lt;/tr&gt;
                          @empty
                          &lt;center&gt;&lt;p&gt;no data&lt;/p&gt;&lt;/center&gt;
                          @endforelse
                      &lt;/tbody&gt;
                  &lt;/table&gt;
  </code></pre>