updated api Cartoons
This commit is contained in:
parent
95955c989b
commit
bb602f97b3
|
|
@ -55,10 +55,13 @@ class CartoonsController extends Controller
|
|||
|
||||
$data = $this->Cartoons::find($id);
|
||||
|
||||
if ($data){
|
||||
if (!is_null($data)){
|
||||
return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);
|
||||
} else {
|
||||
$this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']);
|
||||
// dd("d");
|
||||
// $this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']);
|
||||
return $this->helpers->apiArrayResponseBuilder(404, 'error', [$data]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -117,7 +120,12 @@ class CartoonsController extends Controller
|
|||
public static function getBeforeFilters() {return [];}
|
||||
public static function getMiddleware() {return [];}
|
||||
public function callAction($method, $parameters=false) {
|
||||
if(isset($parameters['cartoon'])) $parameters = [$parameters['cartoon']];
|
||||
return call_user_func_array(array($this, $method), $parameters);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue