public function index(Request $request)
{
$jobs = Job::where('status', 1)->paginate(15);
return view('index')->with('jobs', $jobs);
}
public function index(Request $request)
{
$city = $request->city;
$experience = $request->experience;
$type = $request->type;
$schedule = $request->schedule;
$jobs = Job::when($city, function ($query) use ($city) {
return $query->where('city', $city);
})
->when($type, function ($query) use ($type) {
return $query->where('type', $type);
})
->paginate(15);
return view('index')->with('jobs', $jobs);
}