a simple trait to use with your Laravel Models
composer require ssistemas/searchable:"1.*"
just add in your models
class User extends Model
{
use Ssistemas\Searchable\Traits\Searchable;
private $searchable = [
'columns'=>['category.name'],
'joins'=>[
'customers' => ['category.id','user.category_id'],
],
'orders'=>['category.name,asc'],
];
...
}
you can also use controller
$users = User::search($value)->get();