© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Jonas Siewertsen 🇪🇺

How to pass Entry id into ViewField

I want do something like this in my resource:

ViewField::make('frontend-link')
     ->view('filament.fields.frontend-link')
     ->viewData([
        'id' => $modelId // A closure seems not to be an option
        // 'id' => fn (Model $record): ?string => $record->id // Not working
     ])
ViewField::make('frontend-link')
     ->view('filament.fields.frontend-link')
     ->viewData([
        'id' => $modelId // A closure seems not to be an option
        // 'id' => fn (Model $record): ?string => $record->id // Not working
     ])


What's the best way to pass my model id into the view?
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

viewfield
FilamentFFilament / ❓┊help
3y ago
How to pass vlsue into Class importer
FilamentFFilament / ❓┊help
3y ago
Dependent ViewField?
FilamentFFilament / ❓┊help
3y ago
How to pass data into a filament page?
FilamentFFilament / ❓┊help
2y ago