You can use get request to accomplish this. Lets say you have a form in your view that looks like that:
<form method="GET">
<input type="text" name="name">
<input type="checkbox" name="hasCoffeeMachine" value="1"><span> Apply Filter</span>
</form>
You should specify the route in your routes.php file like that:
Route::get('/', 'SearchController@search');
In your SearchController you'd have a method search that takes the values and performs the query:
class SearchController extends Controller {
public function search() {
// Sets the parameters from the get request to the variables.
$name = Request::get('name');
$hasCoffeeMachine = Request::get('hasCoffeeMachine');
// Perform the query using Query Builder
$result = DB::table('customers')
->select(DB::raw("*"))
->where('name', '=', $name)
->where('has_coffee_machine', '=', $hasCoffeeMachine)
->get();
return $result;
}
}