title: Update only the value of one field in controller in Laravel 6
body: <p>My project requires that the admin has to approve the item uploaded by the user in order for this item to be seen in the website as in sort of validation or some kind of keeping everything under control.
  so in the Item table, I have a field called (status) and has a default value = (denied).</p>
  
  <p><code>$table-&gt;enum('status',['available','denied'])-&gt;default('denied');</code></p>
  
  <p>The admin sees all items and I want a button next to each item called approve if the admin clicks it the status change from denied to approved, how can I create a function in the controller that changes only the status field? one besides the default edit and update function that is already working in my controller.</p>
  
  <pre class="lang-php prettyprint-override"><code>public function edit($itemid)
  {
      $where = array('itemid' =&gt; $itemid);
      $data['item_info'] = Item::where($where)-&gt;first();
  
      return view('items.edititem', $data);
  }
  
  public function update(Request $request, $itemid)
  {
      $request-&gt;validate([
          'name' =&gt; 'required',
          'description' =&gt; 'required',
          'state' =&gt; 'required',
          'price' =&gt; 'required',
          'charityfee' =&gt; 'required',
          'status' =&gt; 'required',
          'category' =&gt; 'required',
      ]);
  
      $update = [
          'name' =&gt; $request-&gt;name, 'description' =&gt; $request-&gt;description,
          'state' =&gt; $request-&gt;state, 'price' =&gt; $request-&gt;price,
          'charityfee' =&gt; $request-&gt;charityfee, 'status' =&gt; $request-&gt;status,
          'category' =&gt; $request-&gt;category, 'itemphoto' =&gt; $request-&gt;itemphoto
      ];
      Item::where('itemid', $itemid)-&gt;update($update);
  
      return Redirect::to('profile')
          -&gt;with('success', 'Great! item updated successfully');
  }
  </code></pre>
  
  <p>Although I tried this following code, an error appeared that the function I have called is not defined:(</p>
  
  <pre><code>public function editstatus($itemid)
          {
            Item::where('itemid', $itemid)-&gt;update(array('itemid' =&gt; 'available'));
  
          } 
  </code></pre>
  
  <p><em>function in controller</em></p>
  
  <pre><code>&lt;td&gt;&lt;a href="{{ route('items.editstatus',$item-&gt;itemid)}}" class="btn btn-primary"&gt;approve&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p><em>the code in the view</em></p>