route version 208

This commit is contained in:
merdan 2021-12-08 21:24:11 +05:00
parent fc1beed148
commit 1e0572c376
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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']);