Ejemplo n.º 1
0
 /**
  * Show a physician
  *
  * @return void
  * @author PJ
  */
 public function show($id)
 {
     $physician = Physician::find($id);
     return $this->response->withItem($physician, new PhysicianTransformer());
 }
Ejemplo n.º 2
0
 /**
  * Show a physician
  *
  * @return void
  * @author PJ
  */
 public function show($id)
 {
     $physician = Physician::find($id);
     if ($physician) {
         return $this->response->withItem($physician, new PhysicianTransformer());
     }
     $errorMeta = ['error' => ['code' => 'GEN-NOT-FOUND', 'http_code' => 404, 'message' => 'Physician not found']];
     return $this->response->withArray($errorMeta);
     //$resource = new Fractal\Resource\Item($phys, new PhysicianTransformer);
     //$output = $this->manager->createData($resource)->toArray();
     //return $output;
     //return $this->respond([
     //'data' => $this->physicianTransformer->transform($physician)
     //]);
 }