Source: jmourajn.medium.com

Eloquent Search Examples
Let's start with a basic scenario, A tenant has N users, each user has a config and a profile: Bring all users wich have: user column is_active in config relationship equals trueuser column address in profile relationship contains “Foo”user column tenant_id equals 1 Pure Eloquent: Eloquent Search: Bring a list of user pictures, from a specific tenant, following the conditions: user column is_active in config equals falseuser column created_at must be greater than equal 2000–01–01 or nullPicture is a column in profile table, Pure Eloquent:Eloquent Search Search all profiles wich: - Columns address, street and number contains at least one word of this sentence “Lorem Ipsum Ignolis” Eloquent Search: In profile Model: Sea rch users with ID greater than 100Exclude users with ID is between 200 and 300Exclude users with status_id is in [1,4,6] Bring all users wich profile.cash_amount is different from zero OR users with column is_superadmin equals true
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners