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

@@ -131,6 +131,8 @@ class RateCardController extends Controller
'content_showcase.*.name' => 'required_with:content_showcase|string|max:255',
'content_showcase.*.url' => 'nullable|url',
'content_showcase.*.thumbnail_path' => 'nullable|string',
'content_showcase.*.show_on_public' => 'nullable',
'content_showcase.*.show_on_pdf' => 'nullable',
]);
$profile = RateCardProfile::getSingleton();
@@ -141,7 +143,12 @@ class RateCardController extends Controller
}
$validated['show_prices'] = $request->has('show_prices');
$validated['content_showcase'] = $request->input('content_showcase', []);
$contentShowcase = $request->input('content_showcase', []);
foreach ($contentShowcase as &$item) {
$item['show_on_public'] = filter_var($item['show_on_public'] ?? true, FILTER_VALIDATE_BOOLEAN);
$item['show_on_pdf'] = filter_var($item['show_on_pdf'] ?? true, FILTER_VALIDATE_BOOLEAN);
}
$validated['content_showcase'] = $contentShowcase;
unset($validated['logo']);
$profile->update($validated);