add posts api pgn

This commit is contained in:
gerchek 2022-01-20 22:17:52 +05:00
parent fa21ac42f3
commit cb89d50386
1 changed files with 3 additions and 3 deletions

View File

@ -30,8 +30,8 @@ class categoriesController extends Controller
}
public function show($id){
// $input = \Input::all();
// $pgn=$input['pgn'];
$input = \Input::all();
$pgn=$input['pgn'];
// $data = $this->Post::with(['translations:locale,model_id,attribute_data','categories'])->get();
$dataaaa = $this->Category::with(['translations:locale,model_id,attribute_data','posts.featured_images' , 'posts.translations'])->find($id);
// $data = Post::where('categories:id', $dataaaa['id'])->get();
@ -39,7 +39,7 @@ class categoriesController extends Controller
{
$q->where('id' , $dataaaa['id']);
})->with(['translations:locale,model_id,attribute_data','featured_images'])->paginate(2);
})->with(['translations:locale,model_id,attribute_data','featured_images'])->paginate($pgn);
if ($data){
return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);