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); }