From 907bbc7967ac10e410e121d29f562f705d3e9309 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Tue, 12 Jan 2021 18:17:36 +0100 Subject: [PATCH] More www --- app/Http/Controllers/PublicController.php | 4 ++++ resources/views/themes/gallery/default/list.blade.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php index 6a46eaf..4f78e1b 100644 --- a/app/Http/Controllers/PublicController.php +++ b/app/Http/Controllers/PublicController.php @@ -35,6 +35,10 @@ class PublicController extends BaseController $tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail(); $gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery); $images = Image::query()->where("gallery", "=", $gallery->id)->get(); + $domains = explode(",", env("DOMAINS", "localhost")); + foreach($images as $image) { + $image->domain = $domains[array_rand($domains)]; + } return view("themes.gallery.default.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]); } diff --git a/resources/views/themes/gallery/default/list.blade.php b/resources/views/themes/gallery/default/list.blade.php index 6c83f45..0ba101e 100644 --- a/resources/views/themes/gallery/default/list.blade.php +++ b/resources/views/themes/gallery/default/list.blade.php @@ -7,8 +7,8 @@
@foreach($images as $image) - - {{ $image->filename }} + + {{ $image->filename }} @endforeach