feat: add visibility toggles for content showcase items on public and PDF views

This commit is contained in:
I-Fun
2026-04-06 08:29:47 +07:00
parent 1c73279e52
commit a72eec3ead
4 changed files with 76 additions and 45 deletions

View File

@@ -299,12 +299,17 @@
</div>
@endif
@if(!empty($profile->content_showcase))
@php
$pdfShowcase = array_filter($profile->content_showcase ?? [], function($item) {
return !isset($item['show_on_pdf']) || $item['show_on_pdf'];
});
@endphp
@if(!empty($pdfShowcase))
<div style="page-break-before: always;"></div>
<div class="platform-section" style="margin-top:20px; page-break-inside:avoid;">
<div class="platform-title" style="text-align:center;">Content Showcase</div>
<div style="text-align:center; padding-top:10px;">
@foreach($profile->content_showcase as $item)
@foreach($pdfShowcase as $item)
@php
$isUrl = ($item['file_id'] === 'url');
$file = !$isUrl ? \App\Models\MediaFile::find($item['file_id']) : null;