boyjarv
6 months ago
1316
28
Eloquent

Search not working?!

Posted 6 months ago by boyjarv

Only the first part of my search works?! propname Please help

$properties = Property::where('propname', 'LIKE', "%{$propname}%")
                ->where(static function ($query) use ($proptype_id, $propname, $minbeds, $category_id, $town) {
                    $query->where('proptype_id', '=', $proptype_id)
                        ->orWhere('propname', 'LIKE', "%".$propname."%")
                        ->orWhere('bedroom', '>', $minbeds)
                        ->orWhere('category_id', '=', $category_id)
                        ->orWhere('town', '=', $town);
                })->paginate(20);

Please sign in or create an account to participate in this conversation.