Esempio n. 1
0
 /**
  * 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());
 }
Esempio n. 2
0
 /**
  * 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]);
 }
Esempio n. 3
0
 /**
  * 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());
 }