Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  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'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement