Gib Website-Bilder aus dem Medienmanager frei, ohne sie zu lizenzieren.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
72130d66c5
commit
13530b8171
18 files changed
+940
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Media\WebsiteMedia;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class WebsiteMediaController extends Controller
|
||||
{
|
||||
public function show(ContentElement $element, WebsiteMedia $media): StreamedResponse
|
||||
{
|
||||
$presentation = $media->present($element);
|
||||
abort_if($presentation === null, 404);
|
||||
|
||||
$path = $element->website_public_path;
|
||||
abort_if(! is_string($path), 404);
|
||||
|
||||
return Storage::disk('media_public')->response($path, null, [
|
||||
'Content-Disposition' => 'inline',
|
||||
'X-Content-Type-Options' => 'nosniff',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user