From e64139cd09cfbd9314287f117c5fb7049394d122 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Mon, 8 Feb 2021 01:23:05 +0100 Subject: [PATCH] Stuff --- app/Http/Controllers/PublicController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php index a76ac0f..990dc10 100644 --- a/app/Http/Controllers/PublicController.php +++ b/app/Http/Controllers/PublicController.php @@ -39,9 +39,9 @@ class PublicController extends BaseController } $g = collect($galleries); - $r = $g->forPage(1, 10); + $r = $g->forPage($request->input("page", 1), 10); - return response()->json(["data" => \App\Http\Resources\Gallery::collection($r)]); + return response()->json([["pagination" => ["total" => $g->count(), "pages" => ($g->count() / 10)], "data" => \App\Http\Resources\Gallery::collection($r)]); } public function listGalleriesView($name, Request $request) { $tenant = Tenant::query()->where("url", "=", $name)->firstOrFail();