File tree Expand file tree Collapse file tree
app/Filament/Resources/MyPollResource/Pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ protected function handleRecordCreation(array $data): Model
3333 'title ' => $ question ['data ' ]['title ' ],
3434 'description ' => $ question ['data ' ]['description ' ],
3535 'question_type_id ' => $ question ['data ' ]['question_type_id ' ],
36- 'options ' => collect ($ question ['data ' ]['options ' ])->filter (function ($ option ) {
36+ 'options ' => collect ($ question ['data ' ]['options ' ] ?? [] )->filter (function ($ option ) {
3737 return $ option ['title ' ] !== null ;
3838 })->map (function ($ option ) {
3939 return [
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ protected function mutateFormDataBeforeSave(array $data): array
3131 'title ' => $ question ['data ' ]['title ' ],
3232 'description ' => $ question ['data ' ]['description ' ],
3333 'question_type_id ' => $ question ['data ' ]['question_type_id ' ],
34- 'options ' => collect ($ question ['data ' ]['options ' ])->filter (function ($ option ) {
34+ 'options ' => collect ($ question ['data ' ]['options ' ] ?? [] )->filter (function ($ option ) {
3535 return $ option ['title ' ] !== null ;
3636 })->map (function ($ option ) {
3737 return [
You can’t perform that action at this time.
0 commit comments