feat: add visibility toggles for content showcase items on public and PDF views
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user