How to add multiple images to a model

There are a lot of post already, but still trying to get my head around it: how to add multiple images to a model? I need to have 1 or 2 images for my model, but not a some collection, but as separate images. I tried this:
SpatieMediaLibraryFileUpload::make('logo')
->label('Logo')
->columnSpan(6),
SpatieMediaLibraryFileUpload::make('logo_alternative')
->label('Logo Alternative')
->columnSpan(6),
SpatieMediaLibraryFileUpload::make('logo')
->label('Logo')
->columnSpan(6),
SpatieMediaLibraryFileUpload::make('logo_alternative')
->label('Logo Alternative')
->columnSpan(6),
But that results in just one record inside my Media table. Not sure if I'm doing this right?
2 Replies
Dan Harrin
Dan Harrin2y ago
give them different collection()
Daniel Plomp
Daniel PlompOP2y ago
Thanks. I'll try it.
Want results from more Discord servers?
Add your server