/** * @param $id * @return mixed */ public function show($id) { //$species = Species::find($id); $species = Species::with('weights', 'type')->find($id); if (!$species) { return $this->respondNotFound('Species does not exist.'); } return $this->respond(['data' => $this->speciesTransformer->transform($species)]); }
public function index() { $events = Event::orderBy('id')->get(); return $this->respond(['currentEvent' => $this->eventsTransformer->transform(Event::assign()), 'data' => $this->eventsTransformer->transformCollection($events->all())]); }