SHARE
TWEET

Untitled

a guest Apr 21st, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Add this to the "boot()" method of your "AppServiceProvider"
  2.  
  3. <?php
  4.  
  5. \Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) {
  6.     return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : '');
  7. });
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