Stuff
This commit is contained in:
parent
0ac289a1ee
commit
3df8751306
1 changed files with 8 additions and 2 deletions
|
@ -39,9 +39,15 @@ class PublicController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
$g = collect($galleries);
|
$g = collect($galleries);
|
||||||
$r = $g->forPage($request->input("page", 1), 10);
|
$page = $request->input("page", 1)
|
||||||
|
$r = $g->forPage($page, 10);
|
||||||
|
|
||||||
return response()->json(["pagination" => ["total" => $g->count(), "items_per_page" => 10, "pages" => ($g->count() / 10)], "data" => \App\Http\Resources\Gallery::collection($r)]);
|
return response()->json(["pagination" => [
|
||||||
|
"total" => $g->count(),
|
||||||
|
"items_per_page" => 10,
|
||||||
|
"pages" => ($g->count() / 10)],
|
||||||
|
"next" => url("/".$tenant->url.".json?page=".($page+1)),
|
||||||
|
"data" => \App\Http\Resources\Gallery::collection($r)]);
|
||||||
}
|
}
|
||||||
public function listGalleriesView($name, Request $request) {
|
public function listGalleriesView($name, Request $request) {
|
||||||
$tenant = Tenant::query()->where("url", "=", $name)->firstOrFail();
|
$tenant = Tenant::query()->where("url", "=", $name)->firstOrFail();
|
||||||
|
|
Loading…
Reference in a new issue