public function show(Request $request)
 {
     if (!$request->has('query')) {
         return redirect('search');
     }
     $input = $request->all();
     // Search jobs in city
     $task = \App\Employer::where('location', 'like', '%' . $input['query'] . '%')->get();
     $tasks = [];
     foreach ($task as $t) {
         $tasksOfEmp = \App\Task::where('employer_id', '=', $t->user_id)->where('available', '=', true)->get();
         foreach ($tasksOfEmp as $t2) {
             array_push($tasks, $t2);
         }
     }
     return view('search.result')->with('results', $tasks);
     // return $tasks;
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $eid 	employer_id
  * @param  int  $id		jobpost_id
  * @return Response
  */
 public function destroy($eid, $id)
 {
     $employer = Employer::findOrFail($eid);
     $jobpost = Jobpost::findOrFail($id);
     $jobpost->delete();
     return view('jobposts.index', compact('employer'));
 }
Пример #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $employer = Employer::findOrFail($id);
     $employer->delete();
     //return view('employers.index', compact('employer'));
     return redirect('/');
 }