© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
3 replies
Aivirth

Using Spatie Media Library on Create

I'm having an issue trying to use the SpatieMediaLibraryFileUpload component on creation of a new resource entry.
It's giving me a missing model_id for the sql insert, which make sense since technically the model is not created yet, but i was wondering if there's a way to make filament create the db entry for media after my new record has been created so the association is successful.
Solution
Update: I found out the issue was caused by me extending from
Illuminate\Database\Eloquent\Relations\Pivot
Illuminate\Database\Eloquent\Relations\Pivot
instead of
Illuminate\Database\Eloquent\Model
Illuminate\Database\Eloquent\Model
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Spatie Media Library
FilamentFFilament / ❓┊help
10mo ago
Spatie Media Library
FilamentFFilament / ❓┊help
14mo ago
filament-spatie-media-library
FilamentFFilament / ❓┊help
15mo ago
spatie media library Wizard
FilamentFFilament / ❓┊help
2y ago