add posts api pgn
This commit is contained in:
parent
fa21ac42f3
commit
cb89d50386
|
|
@ -30,8 +30,8 @@ class categoriesController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id){
|
public function show($id){
|
||||||
// $input = \Input::all();
|
$input = \Input::all();
|
||||||
// $pgn=$input['pgn'];
|
$pgn=$input['pgn'];
|
||||||
// $data = $this->Post::with(['translations:locale,model_id,attribute_data','categories'])->get();
|
// $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);
|
$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();
|
// $data = Post::where('categories:id', $dataaaa['id'])->get();
|
||||||
|
|
@ -39,7 +39,7 @@ class categoriesController extends Controller
|
||||||
{
|
{
|
||||||
$q->where('id' , $dataaaa['id']);
|
$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){
|
if ($data){
|
||||||
return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);
|
return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue