This commit is contained in:
Kekskurse 2021-01-20 00:12:50 +01:00
parent 535fd238e3
commit 7cde2db61a

View file

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