ImageEntry relationship get url

hi, i've this:
Fieldset::make('Foto')
->relationship('photos')
->schema([
Infolists\Components\ImageEntry::make('name')
->url(fn ($record) => Storage::url($record->name), shouldOpenInNewTab: true)
->label('')->height(90)->width(90)->columnSpanFull(),
])->columns(5),
Fieldset::make('Foto')
->relationship('photos')
->schema([
Infolists\Components\ImageEntry::make('name')
->url(fn ($record) => Storage::url($record->name), shouldOpenInNewTab: true)
->label('')->height(90)->width(90)->columnSpanFull(),
])->columns(5),
but this ->url(fn ($record) => Storage::url($record->name), shouldOpenInNewTab: true) doesn't work....how can i retrieve the attribute name of the relationship photos? thanks
1 Reply
ocram82
ocram822mo ago
a little update, i try to use $state here ->url(fn ($state) => Storage::url($state), shouldOpenInNewTab: true) but state contains the array of name attributes of all relationship items. There is a way to indicize it?