Add downloads and FAQs functionality to SolutionResource: implement repeaters for downloads and FAQs in the form, update Solution model to include new fields, and enhance the show view to display downloads and FAQs dynamically, improving content management and user experience.
This commit is contained in:
1 parent
e97a80bfdb
commit
0a3fdf347f
5 files changed
+125
-43
No files matched your search
@@ -49,6 +49,34 @@ public static function form(Form $form): Form
|
||||
->columnSpanFull()
|
||||
->createItemButtonLabel('Add Bullet Point')
|
||||
->defaultItems(1),
|
||||
Forms\Components\Repeater::make('downloads')
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('title')
|
||||
->label('Download Title')
|
||||
->required(false),
|
||||
Forms\Components\FileUpload::make('file')
|
||||
->label('Download File')
|
||||
->required(false)
|
||||
->disk('public')
|
||||
->directory('solution-downloads'),
|
||||
])
|
||||
->columns(1)
|
||||
->columnSpanFull()
|
||||
->createItemButtonLabel('Add Download Item')
|
||||
->defaultItems(1),
|
||||
Forms\Components\Repeater::make('faqs')
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('question')
|
||||
->label('Question')
|
||||
->required(),
|
||||
Forms\Components\RichEditor::make('answer')
|
||||
->label('Answer')
|
||||
->required(),
|
||||
])
|
||||
->columns(1)
|
||||
->columnSpanFull()
|
||||
->createItemButtonLabel('Add FAQ')
|
||||
->defaultItems(1),
|
||||
Forms\Components\RichEditor::make('description')
|
||||
->required()
|
||||
->columnSpanFull(),
|
||||
|
||||
Reference in new issue
Block a user