Spatie Media Library

always get this error App\Models\Repair::Spatie\MediaLibrary{closure}(): Argument #1 ($mediaItem) must be of type Spatie\MediaLibrary\MediaCollections\Models\Media, string given
Components\Section::make('Images')
->headerActions([
Action::make('AddImages')

->icon('heroicon-s-photo')
->form([
SpatieMediaLibraryFileUpload::make('repair_images')
->collection('repair_images')
->label('Immagini')
->multiple()
->reorderable()
->disableLabel()
->downloadable()
->image()
->visibility('public') // se necessario
->columnSpanFull(),
])

])
->compact()
->icon('heroicon-s-photo')
->schema([

])->collapsed(),

/* end image gallery */
Components\Section::make('Images')
->headerActions([
Action::make('AddImages')

->icon('heroicon-s-photo')
->form([
SpatieMediaLibraryFileUpload::make('repair_images')
->collection('repair_images')
->label('Immagini')
->multiple()
->reorderable()
->disableLabel()
->downloadable()
->image()
->visibility('public') // se necessario
->columnSpanFull(),
])

])
->compact()
->icon('heroicon-s-photo')
->schema([

])->collapsed(),

/* end image gallery */
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?