title: Detach Laravel 5.3
body: <p>After some hours debugging and trying to solve a problem, I don't found the solution. So, I hope that you can help me.</p>
  
  <p>I have this little piece of code:</p>
  
  <pre><code>$removed = false;
  if ($store-&gt;persons-&gt;contains($person)) {
      $store-&gt;persons()-&gt;detach($person);
      $removed = true;
  }
  
  var_dump($removed);
  </code></pre>
  
  <p>My problem is that I can't understand why $remove is "false" always.
  If I comment the line  $store->persons()->detach($person);, everything works as expected and $removed will be "true". I can't understand why this is happening, but I hope that you can help me.</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>public function removePerson(Request $request, $storeId, $personId)
  {
      $store = Store::findOrFail($storeId);
      $person = Cashier::findOrFail($personId);
  
      $removed = false;
      if ($store-&gt;persons-&gt;contains($person)) {
          $store-&gt;persons()-&gt;detach($person);
          $removed = true;
      }
  
      return response()-&gt;json([
          'removed' =&gt; $removed,
      ]);
  }
  </code></pre>
  
  <p>Thank you.</p>