Пример #1
0
 /**
  * Display a listing of staffs
  *
  * @return \Response
  */
 public function index($id)
 {
     $job = Jobs::findOrFail($id);
     return \Response::json($job->staff);
 }
Пример #2
0
 /**
  * Remove the specified guitar from storage.
  *
  * @param null $job_id
  * @param $guitar_id
  * @return Response
  * @internal param int $id
  */
 public function destroy($job_id = null, $guitar_id)
 {
     if ($job_id) {
         $job = Jobs::findOrFail($job_id);
         if ($job->guitars->contains($guitar_id)) {
             $job->guitars()->detach($guitar_id);
         }
     }
     return \Response::json(['status' => 'removed']);
 }