pxlrbt / filament-activity-log

Spatie activity log integration into Filament
MIT License
126 stars 24 forks source link

Action isn't being passed the record object #16

Closed kirkbushell closed 10 months ago

kirkbushell commented 11 months ago

After following the steps, seeing this error when listing users:

Missing required parameter for [Route: filament.admin.resources.users.activities] [URI: admin/users/{record}/activities] [Missing parameter: record].

kirkbushell commented 11 months ago

The docs need to be updated to reflect the v3 version of using url - it should be passed a callback, then pass the record into the getUrl paramters.

albertobenavides commented 10 months ago

Im doing this:

Action::make('activities')
                    ->url(fn (ModelName $record): string => ModelNameResource::getUrl() . "/$record->id/activities")
kirkbushell commented 10 months ago

Im doing this:

Action::make('activities')
                    ->url(fn (ModelName $record): string => ModelNameResource::getUrl() . "/$record->id/activities")

Yup, exactly - as I said, it needs to be passed a callback, not just the record object, as per the documentation ;)

pxlrbt commented 10 months ago

Now I got this. Was looking at the getPages() registration and didn't get what was wrong. I updated the readme.