F
Filament10mo ago
fabrice

MarkdownEditor feat Spatie Media Library

Hi! I tried to custom image upload of MarkdownEditor forms component and use Spatie Media Library package for all uploaded images. Following code doesn't work but on create (throw $record is null)
Forms\Components\MarkdownEditor::make('content')
->saveUploadedFileAttachmentsUsing(function (Post $record, TemporaryUploadedFile $file) {
return $record
->addMedia($file);
})
->getUploadedAttachmentUrlUsing(function (Media $file) {
return $file->getFullUrl();
})
Forms\Components\MarkdownEditor::make('content')
->saveUploadedFileAttachmentsUsing(function (Post $record, TemporaryUploadedFile $file) {
return $record
->addMedia($file);
})
->getUploadedAttachmentUrlUsing(function (Media $file) {
return $file->getFullUrl();
})
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server