public function job($job)
 {
     $jobParts = explode('-', $job);
     $job = DB::select("EXEC spJobByID_Select @JobID = {$jobParts['0']}")[0];
     $latest = JobController::getLatestJobs();
     $latest = array_slice($latest, 0, 3);
     return View::make('job')->withJob($job)->withRecommended(self::getRecommendedJobs())->withLatest($latest);
 }
 /**
  * Candidate FrontPage Route
  **/
 public function candidatesFrontPage()
 {
     if (is_null(Session::get('candidate'))) {
         return Redirect::to('become-a-candidate')->with('info', 'Please login / register to view this page');
     }
     $output = array();
     $output['latest'] = JobController::getLatestJobs();
     $candidate = Candidate::find(Session::get('candidate')->id);
     $testimonial = Content::where('type', 'testimonial')->where('client_facing', 1)->get()->random(1);
     return View::make('candidate.profile', $output)->with(compact('candidate'))->with(compact('testimonial'));
 }
 public function homepage()
 {
     $output = array();
     $output['messages'] = Content::where('type', 'homepage')->get();
     $output['testimonial'] = Content::where('type', 'testimonial')->where('candidate_facing', 1)->get()->random(1);
     $output['latest'] = JobController::getLatestJobs();
     if (Session::has('candidate')) {
         $output['candidate'] = Session::get('candidate');
     }
     return View::make('homepage.main', $output);
 }