b2in/app/Http/Controllers/Api/DisplayPreviewController.php
Kevin Adametz 6c6d683b9a Display CMS Optimierungen 29-05-2026
- Mediathek: Video-Vorschaubilder statt Icons (FFmpeg-Thumbnails + Backfill-Command), Kategorie "Sonstiges"
- B2in Media-Picker zeigt alle Medientypen, Typ wird automatisch erkannt; Thumbnail-Preview vor allen Medien-URL-Feldern
- B2in Marke/Footer: Footer ein/aus, Logo+Claim frei positionierbar (Ecken) mit Constraints, separate Anzeige-Schalter
- Angebote-Modul dynamisch: kein Slide-Typ mehr, einheitliches Detail-Layout mit ein-/ausblendbaren Bloecken, Logo/Brand pro Slide, Streichpreis-Option
- Player: leere Module stoppen Endlosschleife, dynamische Layout-Anpassung bei verstecktem Footer/Header
- Fix: Script-Ladereihenfolge (Livewire vor Flux), entfernte stale public/flux/flux.js, Modal-Crash beim Aktualisieren behoben

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 15:57:33 +00:00

40 lines
1.2 KiB
PHP

<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Display;
use App\Services\DisplayPlaylistConfigBuilder;
use Illuminate\Http\JsonResponse;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class DisplayPreviewController extends Controller
{
public function show(string $token): BinaryFileResponse
{
Display::query()
->where('preview_token', $token)
->firstOrFail();
return response()->file(public_path('_cabinet/display/index.html'), [
'Cache-Control' => 'no-cache, must-revalidate',
]);
}
public function config(string $token, DisplayPlaylistConfigBuilder $configBuilder): JsonResponse
{
$display = Display::query()
->where('preview_token', $token)
->firstOrFail();
$playlist = $display->draftPlaylist()
->with('modules.items')
->first();
if (! $playlist || $playlist->modules->isEmpty()) {
return response()->json(['error' => 'Display preview not configured'], 404);
}
return response()->json($configBuilder->fromPlaylist($playlist));
}
}