/** * Display the specified resource. * * @param int $id * @return \Illuminate\Contracts\Http\Response */ public function show($id) { return $this->respond->setMeta($this->meta)->withItem($this->model->with('things')->findOrFail($id), new AuthorTransformer()); }
/** * Exposure a listing of the endpoints. * * @param \Appkr\Fractal\Http\Response $response * @return \Illuminate\Contracts\Http\Response */ public function index(Response $response) { $payload = ['resources' => route('v1.things.index'), 'authors' => route('v1.authors.index')]; return $response->setMeta(['message' => "Hello, I'm a appkr/fractal example api", 'version' => 1, 'documentation' => route('v1.doc')])->respond(['link' => $payload]); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Contracts\Http\Response */ public function show($id) { return $this->respond->setMeta(['version' => 1])->withItem($this->model->findOrFail($id), new ThingTransformer()); }