From 7cde2db61ac670fa5ba7a8ee05bb8e707cb3e34f Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Wed, 20 Jan 2021 00:12:50 +0100 Subject: [PATCH] Stuff --- app/Http/Controllers/PublicController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php index 4be15b9..d2dd656 100644 --- a/app/Http/Controllers/PublicController.php +++ b/app/Http/Controllers/PublicController.php @@ -46,7 +46,12 @@ class PublicController extends BaseController $tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail(); $gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery); if($gallery->status == "online" || (Auth::check() && $gallery->status == "preview" && Auth::user()->id == $tenant->owner)) { - $images = Image::query()->where("gallery", "=", $gallery->id)->whereNull("deleted_at")->get(); + $images = Image::query() + ->where("gallery", "=", $gallery->id) + ->whereNull("deleted_at") + ->orderBy("rating") + ->orderBy("DateTimeOriginal") + ->get(); } else { abort( 404); }