Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add this to the "boot()" method of your "AppServiceProvider"
- <?php
- \Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) {
- return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : '');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement