23-01-2026
This commit is contained in:
parent
07959c0ba2
commit
854ce02bf6
166 changed files with 32909 additions and 1262 deletions
43
app/Http/Controllers/Api/DisplayConfigController.php
Normal file
43
app/Http/Controllers/Api/DisplayConfigController.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\DisplayVideo;
|
||||
use App\Models\DisplayFooterContent;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class DisplayConfigController extends Controller
|
||||
{
|
||||
/**
|
||||
* Gibt die Konfiguration für die Display-Seite zurück
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$videos = DisplayVideo::active()->get()->map(function ($video) {
|
||||
return [
|
||||
'src' => $video->full_path,
|
||||
'position' => $video->position,
|
||||
];
|
||||
});
|
||||
|
||||
$footerContent = DisplayFooterContent::active()->get()->map(function ($footer) {
|
||||
$data = [
|
||||
'headline' => $footer->headline,
|
||||
'subline' => $footer->subline,
|
||||
];
|
||||
|
||||
// URL nur hinzufügen wenn vorhanden
|
||||
if ($footer->url) {
|
||||
$data['url'] = $footer->short_url;
|
||||
}
|
||||
|
||||
return $data;
|
||||
});
|
||||
|
||||
return response()->json([
|
||||
'videoPlaylist' => $videos,
|
||||
'footerContent' => $footerContent,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue