0👍
You need to use filled
instead of has
if you want to check if a value is present on the request and is not empty.
......
if ($request->filled('fuel')) {
$car = $car->where('fuel', $request->input('fuel'))->with('images');
}
......
See: https://laravel.com/docs/5.8/requests – Section: Determining If An Input Value Is Present
Source:stackexchange.com