/home/techb158/ileadtechnology.com/app/Http/Controllers
Edit: /home/techb158/ileadtechnology.com/app/Http/Controllers/SearchController.php (1275B)
input('searchTerm');
if(isset($searchTerm))
{
$search_data = collect();
$course_title = Course::where('title', 'LIKE', "%$searchTerm%")->where('status','=',1)->get();
if (isset($course_title) && count($course_title) > 0)
{
$search_data->push($course_title);
}
$course_tags = Course::where('tags', 'LIKE', "%$searchTerm%")->where('status','=',1)->get();
if (isset($course_tags) && count($course_tags) > 0)
{
$search_data->push($course_tags);
}
$search_data = $search_data->flatten();
$courses = Course::search($searchTerm)->paginate(20);
return view('front.search', compact('search_data', 'searchTerm'));
}
else
{
return back()->with('delete', trans('flash.NoSearch'));
}
}
}