public function getHome() { $postedjobs = PostedJob::with('industry', 'employer', 'exam', 'subject')->where('status', 1)->orderBy('created_by', 'ASC')->paginate(20); $top_jobs = PostedJob::with('industry', 'employer')->where('status', 1)->orderBy('salary_offered_min', 'DESC')->take(5)->get(); //here I am taking 5 recrds with highest minimum salary and only the available jobs // $filtered = $collection->filter(function ($item) { // return $item > 2; // }); return view('webfront.index', compact('postedjobs', 'top_jobs')); }
public function viewJob($id) { $decoded = Hashids::decode($id); $id = $decoded[0]; $results = PostedJob::with('industry')->with('district', 'exam', 'subject', 'employer')->findOrFail($id); //dd($results); return view($this->content . 'jobs.view', compact('results')); }