コード例 #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $job = \App\Job::with('responsavel')->find($id);
     $users = \App\User::all();
     $users = $users->lists('name', 'id');
     return view('jobs.edit')->with(compact('job', 'users'));
 }
コード例 #2
0
 public function show($id)
 {
     $job = Job::with('company')->find($id);
     if (!$job) {
         return response()->json(['message' => 'Record not found'], 404);
     }
     return response()->json($job);
 }
コード例 #3
0
 /**
  * Get an array of all tasks.
  * 
  * @return Response
  */
 public function index()
 {
     return Job::with('tasks')->get();
 }