Stuff
This commit is contained in:
parent
e13aba460f
commit
59fed4d0a4
1 changed files with 5 additions and 5 deletions
|
@ -37,10 +37,10 @@ class PublicController extends BaseController
|
|||
foreach ($galleries as $gallery) {
|
||||
$gallery->html = $parser->parse($gallery->description);
|
||||
}
|
||||
|
||||
$limit = $request->input("limit", 10);
|
||||
$g = collect($galleries);
|
||||
$page = $request->input("page", 1);
|
||||
$r = $g->forPage($page, 10);
|
||||
$r = $g->forPage($page, $limit);
|
||||
|
||||
$next = null;
|
||||
$preview = null;
|
||||
|
@ -49,14 +49,14 @@ class PublicController extends BaseController
|
|||
$preview = url("/".$tenant->url.".json?page=".($page-1));
|
||||
}
|
||||
|
||||
if(($g->count() / 10) > $page) {
|
||||
if(($g->count() / $limit) > $page) {
|
||||
$next = url("/".$tenant->url.".json?page=".($page+1));
|
||||
}
|
||||
|
||||
return response()->json(["pagination" => [
|
||||
"total" => $g->count(),
|
||||
"items_per_page" => 10,
|
||||
"pages" => ($g->count() / 10),
|
||||
"items_per_page" => $limit,
|
||||
"pages" => ($g->count() / $limit),
|
||||
"preview" => $preview,
|
||||
"next" => $next],
|
||||
"data" => [
|
||||
|
|
Loading…
Reference in a new issue