Closed prazny closed 11 months ago
Duplicate of https://github.com/filamentphp/filament/issues/6964?
Duplicate of #6964?
Not sure. If i add code metioned in #6964 I have the same problem but proposed correction by @fallback solves it while my problem still persists.
Alright, thanks for checking. It's probably a different bug report I've seen before, or maybe I encountered it myself sometime. Will keep this issue open.
hey @prazny
this will solve your issue:
Infolists\Components\Actions::make([
Actions\Action::make("test")
->url(function (Model $record, Actions\Action $action) {
$data = $action
->getInfolistComponent()
->getContainer()
->getParentComponent()
->getState();
return "https://example.com/" . $data['id'];
})
])
@danharrin we could potentially add this as a check on the infolist action with a fallback to the the non repeatable $record, but I don't know if it would be better as a different parameter to inject since using $record
might be confusing since the contexts aren't really discernible from the code.
Could potentially be an issue with the Actions
container too, since similar behavior being reported with form repeaters involving actions.
it works just fine if you swap Model $model
or Model $record
using the original code example, I didn't even need the suggestion from Adam
Maybe a recent update thing
Package
filament/filament
Package Version
v3.0.68
Laravel Version
v10.26.2
Livewire Version
v3.0.5
PHP Version
PHP 8.1
Problem description
Making RepeatableEntry with Actions is what I'm attempting. I have a model called "Order" that has many "Offers." "Order" models are used in the action functions.
Expected behavior
I have expected to have Offer in action function url()/action();
Steps to reproduce
Reproduction repository
https://github.com/prazny/repeatable-reproduction
Relevant log output
No response