I have a simple question i've been using django and now i moved to laravel and i stuck in this for 2 days
i have form on the index page that will send input to job search page
i used to do like that in django but here its not working
public function job_search(Request $request) {
$keyword = $request->get('keywords');
$location = $request->get('location');
if ($keyword) {
$jobs = Job::where('name', 'like', '%'.$keyword.'%');
if ($location) {
$jobs = Job::where('location', 'like', '%'.$location.'%')->where('name', 'like', '%'.$keyword.'%');
}
}
if ($location) {
$jobs = Job::where('location', 'like', '%'.$location.'%');
}
return view('jobs.job_search', compact('jobs','keyword','location'));
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire