예제 #1
0
 /**
  * @param $id
  * @param Manager $fractal
  * @param MenuTransformer $menuTransformer
  * @return mixed
  */
 public function show($id, Manager $fractal, MenuTransformer $menuTransformer)
 {
     $fractal->setSerializer(new JsonApiSerializer());
     $project = $this->menu->find($id);
     if (!$project) {
         return Response::json(['error' => ['message' => 'Menu não foi encontrado, favor procurar outro nome']], 404);
     }
     $item = new Item($project, $menuTransformer);
     $data = $fractal->createData($item)->toArray();
     return $this->respond($data);
 }