How to simplify Laravel Eloquent where clause?
The following example will give me all users that are older than $age and have the gender $gender: public function get_users_older_than(int $age = null, string $gender = null) { $users = User::query() ->where('age', '>', $age) ->where('gender', $gender) ->get(); return $users;…