diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/CategoriesController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/CategoriesController.php index abb0551f6..50480df3c 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/CategoriesController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/CategoriesController.php @@ -22,6 +22,7 @@ class CategoriesController extends Controller public function index(){ + //categories list $data = $this->Category->select('id','name') ->with(['translations:model_id,locale,attribute_data']) ->where('status',1) @@ -31,6 +32,7 @@ class CategoriesController extends Controller return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); } + //categories item public function show($id){ $data = $this->Category::find($id); diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php index 16771ee74..9480d714d 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php @@ -21,6 +21,7 @@ class postsController extends Controller $this->helpers = $helpers; } + //postes list public function index(){ $path = Config::get('app.cdn').Config::get('cms.storage.media.path'); $data = $this->Post::with(['categories:id,name'])->listFrontEnd([ @@ -43,6 +44,7 @@ class postsController extends Controller return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); } + //posts item public function show($locale,$id){ $post = $this->Post::find($id,['id','content_html','author','slug']);