title: How to remove or unfriend through API
body: <p>This is database structure
  <a href="https://i.stack.imgur.com/AfQga.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AfQga.png" alt="enter image description here"></a>
  This is API</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Route::post('/friend', 'FriendController@index');
  Route::post('/removerequest/{id}', 'FriendController@removerequest');</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is controller code which into friend request method and remove method, but error in remove friend method..
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> public function index(Request $request) {
         
          $sender = Friend::where('sender_id', $request-&gt;sender_id)-&gt;where('receiver_id',$request-&gt;receiver_id)-&gt;first();
          if(empty($sender)){
              Friend::create(['sender_id'=&gt;$request-&gt;sender_id,'receiver_id'=&gt;$request-&gt;receiver_id, 'approved'=&gt;'pending']);
              
              $response = ['message'=&gt;'Friend Request has been sent','status'=&gt;200];
              return response()-&gt;json($response);
          }else{
              $response = ['message'=&gt;'Request has been sent already','status'=&gt;200];
              return response()-&gt;json($response);
          }
          
      }
      public function removerequest($id){
         $friends = Friend::all()
                      -&gt;where('receiver_id')
                      -&gt;where('sender_id')
                      -&gt;approved('accept')
                      -&gt;delete();
              
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Error is </p>
  
  <pre><code>BadMethodCallException: Method Illuminate\Database\Eloquent\Collection::approved does not exist. in file /home/ynvih0l26evc/public_html/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php on line 104
  enter code here
  </code></pre>