Call to a member function makeGetUtility() on null

In v4 i get an error on this
->recordActions([

Action::make('fisier_aditional')
->label('Download')
->visible(fn(Get $get, $record): bool => $record->fisier_aditional !== null)
->button()
->icon('heroicon-m-arrow-down-tray')
->action(function (Action $action, $record) {
// and here goes my acction code
}),

])
->recordActions([

Action::make('fisier_aditional')
->label('Download')
->visible(fn(Get $get, $record): bool => $record->fisier_aditional !== null)
->button()
->icon('heroicon-m-arrow-down-tray')
->action(function (Action $action, $record) {
// and here goes my acction code
}),

])
was working fine on v3, any idea if something changed?
3 Replies
Povilas Korop
Povilas Korop3w ago
Haven't tested but looking at the docs, action() function accepts $record as a parameter, no Action needed as a parameter.
Action::make('delete')
->requiresConfirmation()
->action(fn (Post $record) => $record->delete())
Action::make('delete')
->requiresConfirmation()
->action(fn (Post $record) => $record->delete())
Source: https://filamentphp.com/docs/4.x/tables/actions#record-actions
LeandroFerreira
remove Get $get What are you trying to do?
jamesro
jamesroOP3w ago
Thanks, seems removing that unneeded $get sorted the issue

Did you find this page helpful?