You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel package to make it easy to consult eloquente
Install:
composer require wicool/laravel-filters
How to use:
Model app/Models/User.php
<?phpnamespaceApp\Models\User;
useIlluminate\Database\Eloquent\Model;
useWicool\LaraFilter\LaraFilterTrait;
class User extends Model
{
use LaraFilterTrait;
/** * set string fields for filtering * @var array */protected$likeFilterFields = ['name', 'email', 'phone'];
/** * set boolean fields for filtering * @var array */protected$boolFilterFields = ['status'];
}
/users?name=Fulaninho&[email protected]?phone=999999999&status=true
SELECT * FROM users WHERE name = 'Fulaninho' AND email = '[email protected]' AND status = true