© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
4 replies
__Dementor

RepeatableEntry relationship

Hello, I have a infolist code
RepeatableEntry::make('attachments')
  ->schema([
    TextEntry::make('file')
      ->action(Action::make('download_file')->action(function () {
        ??? return Storage::download(path);
      })),
  ])->columns(12)->columnSpan(4),
RepeatableEntry::make('attachments')
  ->schema([
    TextEntry::make('file')
      ->action(Action::make('download_file')->action(function () {
        ??? return Storage::download(path);
      })),
  ])->columns(12)->columnSpan(4),

I would like to make it download a file when clicked but I can't get to the file. I can get Job model in function but in Job model I have a attachments relation where I have all attachment files.
How can I get to just this one file and not all of them?
Solution
@__Dementor Injecting
$record
$record
inside the
action
action
's callback should give you access to the related attachment model. I just used
RepeatableEntry
RepeatableEntry
in exactly this way in one of my Filament apps.

RepeatableEntry::make('attachments')
  ->schema([
    TextEntry::make('file')
      ->action(
        Action::make('download_file')
          ->action(fn (Attachment $record) => Storage::download($record->path))
),
  ]),
RepeatableEntry::make('attachments')
  ->schema([
    TextEntry::make('file')
      ->action(
        Action::make('download_file')
          ->action(fn (Attachment $record) => Storage::download($record->path))
),
  ]),
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

RepeatableEntry relationship
FilamentFFilament / ❓┊help
2w ago
RepeatableEntry not updating after updating Relationship
FilamentFFilament / ❓┊help
4mo ago
RepeatableEntry
FilamentFFilament / ❓┊help
3y ago
Filament: RepeatableEntry not showing relationship data from model
FilamentFFilament / ❓┊help
5mo ago