Merge branch '1.1' of https://github.com/merdiano/orient-site into 1.1
This commit is contained in:
commit
ac1f39706d
|
|
@ -31,8 +31,15 @@ class postsController extends Controller
|
||||||
'category' => input('category'),
|
'category' => input('category'),
|
||||||
'date' => input('date'),
|
'date' => input('date'),
|
||||||
'published' => true,
|
'published' => true,
|
||||||
'select' => ['id','title','published_at',DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]
|
'select' => ['id','title','slug','published_at',DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if($data){
|
||||||
|
$data->each(function ($item, $key) {
|
||||||
|
$item->url = $this->pageUrl('post',['id'=>$item->id,'slug'=>$item->slug]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
|
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue