Stuff
This commit is contained in:
parent
ebc4629c91
commit
fccc353aaa
1 changed files with 7 additions and 1 deletions
|
@ -14,6 +14,7 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use phpDocumentor\Reflection\Types\Integer;
|
use phpDocumentor\Reflection\Types\Integer;
|
||||||
|
@ -44,7 +45,12 @@ class PublicController extends BaseController
|
||||||
public function listGalleryImagesView($tenant, $gallery) {
|
public function listGalleryImagesView($tenant, $gallery) {
|
||||||
$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)->whereNull("deleted_at")->get();
|
if($gallery->status == "online" || ($gallery->status == "preview" && Auth::user()->id == $tenant->owner)) {
|
||||||
|
$images = Image::query()->where("gallery", "=", $gallery->id)->whereNull("deleted_at")->get();
|
||||||
|
} else {
|
||||||
|
abort( 404);
|
||||||
|
}
|
||||||
|
|
||||||
return view("themes.gallery.gallery-detail.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]);
|
return view("themes.gallery.gallery-detail.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue