Your way of thinking is wrong. You cannot use app logic inside of your query. That piece of state should be already available in your database to be able to run queries against it or else you can't.
You need to fetch all of your products and use Collection methods to do the filtering as the price is calculated on the fly. Something like:
$products->reject(static function ($product) {
return $product->price() > request('maxPrice');
});
A better approach would be to save this piece of information with your product in your database so you do not have to fetch them all every single time and can already carry out the filtering via the database query. If it is repetitive logic, you can for example use model observers to calculate that field just before persisting it to the database.