Builder::macro('whereLike', function($columns, $search) {
$this->where(function($query) use ($columns, $search) {
foreach(\Arr::wrap($columns) as $column) {
$query->orWhere($column, $search);
}
});
return $this;
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter