Struggling to figure out how to filter data in view using checkboxes. If only one location is selected, then it's straightforward. But what if multiple locations are selected? Is this a @foreach?
My view
<form method="post" action="filter">
{{ csrf_field() }}
<input type="checkbox" name="locationfilter[]" value="Chicago">Chicago</label>
<input type="checkbox" name="locationfilter[]" value="New York">New York</label>
<button type="submit" class="btn btn-primary"> Submit </button>
My controller
$lofilter = implode(", ", $request->get('locationfilter'));
$mypostings = Postings::where('location', 'LIKE', '%'. $lofilter .'%')->get();
whereINcondition will work for comma separated match in Laravel.