/** * Display the specified resource. * GET /vehicle/{id} * * @param int $id * @return Response */ public function show(VehicleTransformer $transformer, $id) { try { $vehicle = Vehicle::findOrFail($id); } catch (ModelNotFoundException $e) { return $this->respondNotFound('Vehicle does not exist'); } return $this->respondOk(['vehicle' => $transformer->transform($vehicle)]); }
/** * Gets a vehicle by id * * @param $id * @throws ModelNotFoundException * @return Vehicle */ public function get($id) { return Vehicle::findOrFail($id); }