title: Detach single record from pivot table LARAVEL
body: <p>I have two models, <code>Menu</code> and <code>User</code> with <code>many to many relationship</code>. So, at this moment I have lot of records with the same <code>user_id</code> and <code>menu_id</code> in the pivot table, and the user must to can detach only one of them and not all of them.</p>
  <p>So, I made a AJAX request to &quot;remove&quot; one menu from this table:</p>
  <pre><code>function deleteMenuFromOrder(menuFromOrderId){
      event.preventDefault();
      $.ajax({
          type: &quot;GET&quot;,
          url: &quot;/removeMenuFromOrder&quot;,
          data: {
              menuFromOrderId : menuFromOrderId,
              userId : &quot;{{$user-&gt;id}}&quot;,
              _token : &quot;{{csrf_token()}}&quot;
          },
          success: function (response) {
              alert(response);
              // location.reload();
          },
          fail: function(response){
              alert(response);
          }
      });
  }
  </code></pre>
  <p>And this the &quot;controller&quot;:</p>
  <pre><code>Route::get('/removeMenuFromOrder', function (HttpRequest $request) {
      $user = User::findOrFail($request['userId']);
      $user-&gt;menus()-&gt;detach($request['menuFromOrderId']);
      return &quot;Menú eliminado con éxito&quot;;
  });
  </code></pre>
  <p>The <code>menuFromOrderId</code> is the <code>id</code> from pivot table which I want to delete.</p>
  <p>Unfortunately, I can't to upload images on StackOverflow yet, but I have linked one about pivot table's data.</p>
  <p><a href="https://ibb.co/KqR7Cdj" rel="nofollow noreferrer">https://ibb.co/KqR7Cdj</a></p>
  <p>How you can see, I have lot of records with the same user_id and menu_id, if i detach by user_id, all records will be deleted and viceverse.</p>
  <p>So, how can I detach only single record in this case?</p>