You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Filament MarkdownEditor natively supports file uploads and drag-and-drop, as well as handling file visibility/disk/etc.
However, Simple Slides limits users to a certain file space used, and thus we need to use Laravel-medialibrary to track that information, which is different from what the MarkdownEditor natively uses (It just uses Laravel's store or storePublicly functions, which only upload the file and don't add any database records).
Currently, until this issue is addressed, we are disabling file uploads directly on a presentation record via the content field. This is limiting, because it makes sense to have presentation-specific file uploads, instead of requiring all images to be uploaded to the global ImageLibrary.
We can start to get the behavior that we want by using a couple methods that the MarkdownEditor component provides: saveUploadedFileAttachmentsUsing and getUploadedAttachmentUrlUsing. Here is an example:
However, there are some issues with this, hence this issue:
What Needs Done
Based on the code example above, we need to:
Get the current model to associate the images to. $this->getRecord() doesn't work.
Figure out how to handle images for new not-yet-created records. I.e. Can we even attach an image to a new record?
If enabling this feature, then we need a way for users to delete these images too, since they count towards their allotted space. This could potentially be done via a RelationManager for Media records (which would include the thumbnail), but it would make the workflow a bit more complex than normal.
The text was updated successfully, but these errors were encountered:
The Filament MarkdownEditor natively supports file uploads and drag-and-drop, as well as handling file visibility/disk/etc.
However, Simple Slides limits users to a certain file space used, and thus we need to use Laravel-medialibrary to track that information, which is different from what the MarkdownEditor natively uses (It just uses Laravel's
store
orstorePublicly
functions, which only upload the file and don't add any database records).Currently, until this issue is addressed, we are disabling file uploads directly on a presentation record via the content field. This is limiting, because it makes sense to have presentation-specific file uploads, instead of requiring all images to be uploaded to the global ImageLibrary.
We can start to get the behavior that we want by using a couple methods that the
MarkdownEditor
component provides:saveUploadedFileAttachmentsUsing
andgetUploadedAttachmentUrlUsing
. Here is an example:However, there are some issues with this, hence this issue:
What Needs Done
Based on the code example above, we need to:
$this->getRecord()
doesn't work.Media
records (which would include the thumbnail), but it would make the workflow a bit more complex than normal.The text was updated successfully, but these errors were encountered: