I want to make the correct filter for the price, but it gives an error.
In the table there are 2 fields with prices price_weekend_max and price_weekend_max_comm . When outputting these prices, I add them, ie $c->price_weekend_max + $c->price_weekend_max_comm and it turns out one single price at which I try to make a filter.
The filter works according to the following principle: the usual slider from one price to another min / max prices are transferred to the method and there I want to filter the data by request.
$filtered_items = Cottage::orderBy('priority', 'desc'); $filtered_items = $filtered_items ->where('price_weekend_max + price_weekend_max_comm','>=', $data['price_from']) ->where('price_weekend_max + price_weekend_max_comm','<=', $data['price_to']); When the request is an error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column '47000' in 'where clause' (SQL: select count(*) as aggregate from `cottages_new` where `persons_min` >= 1 and `47000` >= 0 and `47000` <= 0 and `publish` = 1)
where('тут должно быть название колонки', ...)->get(), and you have not a name, but probably a value .. - entithat