File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030use Code16 \Sharp \Form \Layout \FormLayoutTab ;
3131use Code16 \Sharp \Form \SharpForm ;
3232use Code16 \Sharp \Utils \Fields \FieldsContainer ;
33+ use Illuminate \Support \Carbon ;
3334use Illuminate \Support \Facades \Blade ;
3435
3536class PostForm extends SharpForm
@@ -130,8 +131,8 @@ public function buildFormFields(FieldsContainer $formFields): void
130131 Including {{ count($attachments) }} attachments
131132 ({{ count($fileAttachments) }} files, {{ count($linkAttachments) }} links).
132133 blade, [
133- 'published_at ' => \ Carbon \Carbon ::parse ($ data ['published_at ' ])->isoFormat ('LLLL ' ),
134- 'author ' => \ App \ Models \ User::find ($ data ['author_id ' ]),
134+ 'published_at ' => isset ( $ data [ ' published_at ' ]) ? Carbon::parse ($ data ['published_at ' ])->isoFormat ('LLLL ' ) : null ,
135+ 'author ' => isset ( $ data [ ' author_id ' ]) ? User::find ($ data ['author_id ' ]) : null ,
135136 'attachments ' => $ data ['attachments ' ] ?? [],
136137 'linkAttachments ' => collect ($ data ['attachments ' ] ?? [])->where ('is_link ' , true ),
137138 'fileAttachments ' => collect ($ data ['attachments ' ] ?? [])->where ('is_link ' , false ),
You can’t perform that action at this time.
0 commit comments