Afisha = $Afisha; $this->helpers = $helpers; } public function index(){ $data = $this->Afisha::with(['translations:model_id,locale,attribute_data'])->paginate(10); return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); } public function show($id){ $data = $this->Afisha::find($id); if ($data){ return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]); } else { $this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']); } } }