More www
This commit is contained in:
parent
d4258392dd
commit
907bbc7967
2 changed files with 6 additions and 2 deletions
|
@ -35,6 +35,10 @@ class PublicController extends BaseController
|
||||||
$tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail();
|
$tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail();
|
||||||
$gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery);
|
$gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery);
|
||||||
$images = Image::query()->where("gallery", "=", $gallery->id)->get();
|
$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]);
|
return view("themes.gallery.default.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
<div id="mygallery">
|
<div id="mygallery">
|
||||||
@foreach($images as $image)
|
@foreach($images as $image)
|
||||||
<a href="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file">
|
<a href="{{$image->domain}}/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file">
|
||||||
<img style="height: 200px;" alt="{{ $image->filename }}" src="/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file"/>
|
<img style="height: 200px;" alt="{{ $image->filename }}" src="{{$image->domain}}/{{ $tenant->url }}/{{ $gallery->url }}/{{ $image->id }}/file"/>
|
||||||
</a>
|
</a>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue