Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Cushty's avatar
Level 4

Modal preview of form coming form blade view

Hi I am trying to work out the best way of getting form data that is not saved in to my preview modal, at the moment I have a modal with a blade view, pulling in data that is saved in the db and it is working well, but im not sure the best way to pull in data to the modal on new additions to the form that are not yet saved?

In my edit application resource I have

Action::make('preview')
                ->label('Preview Profile')
                ->icon('heroicon-o-eye')
                ->modalContent(function () {
                    $record = $this->getRecord();
                    $formData = collect($this->data)->except(['status'])->toArray();
                    $record->fill($formData);

                    return view('application.preview', [
                        'application' => $record,
                        'isPreview' => true
                    ]);
                })
                ->modalWidth('7xl')

the rich editor changes are showing in preview but normal fields or selects are not, what is the best way to achieve a preview with changes that are not yet saves in fIlament as I may be going the wrong route, thanks

0 likes
1 reply
Cushty's avatar
Level 4

Ok i admit defeat, is there a way to just save the data then open the modal? So they save it opens modal with the newly saved data from the form? Thanks

Please or to participate in this conversation.