daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Laravel fixed their model syncing in a recent update
  3.  */
  4.  
  5. // change this (wherever you may see it)
  6. if (request('brand')) {
  7.     $opportunity->brand()->sync(request('brand'));
  8. } else {
  9.     $opportunity->brand()->detach();
  10. }
  11.  
  12. // to just this
  13. $opportunity->brand()->sync(request('brand'));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top