You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose this because I haven't yet found a way to do it. In my case, I have implemented a ViewOrderAction (which displays the OrderInfolist schema in a modal) that extends ViewAction, intending to use that action in different tables, for example.
This works perfectly in the Filament Table.
But an Order needs to be visible in different places in my app to improve the user experience. In my case, each Loan is generated from an Order.
In the Loans Filament Table, I might want to see the associated Order. I'd like to click on the Order Number column and have it display a modal. While I could do this from the loan.order relationship, I'm thinking of using the ViewOrderAction I already have defined.
The problem (which isn't really a problem) is that the Action invoked from a row in a table receives, as expected, the model associated with that row. I tried things like:
ViewOrderAction::make()
...
-> model(Order::class)
->record(fn(Loan $model): Order => $model->order)
...
But nothing worked. The infolist still receives the Loan model when I use ViewOrderAction on the Loans table.
Even more so, having an action to view the order in a modal within the Loans view itself would be desirable.
If I add to this the fact that I have several entities where I can view the order... an even stranger case is where we list all the outstanding installments for different clients. In that case, the relationship is a bit more hidden: installment -> loan -> order, but it would be desirable to view the associated order from that installment in a modal, reusing ViewOrderAction, for example.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I propose this because I haven't yet found a way to do it. In my case, I have implemented a
ViewOrderAction(which displays theOrderInfolistschema in a modal) that extendsViewAction, intending to use that action in different tables, for example.This works perfectly in the Filament Table.
But an Order needs to be visible in different places in my app to improve the user experience. In my case, each Loan is generated from an Order.
In the Loans Filament Table, I might want to see the associated Order. I'd like to click on the Order Number column and have it display a modal. While I could do this from the loan.order relationship, I'm thinking of using the
ViewOrderActionI already have defined.The problem (which isn't really a problem) is that the Action invoked from a row in a table receives, as expected, the model associated with that row. I tried things like:
But nothing worked. The infolist still receives the Loan model when I use
ViewOrderActionon the Loans table.Even more so, having an action to view the order in a modal within the Loans view itself would be desirable.
If I add to this the fact that I have several entities where I can view the order... an even stranger case is where we list all the outstanding installments for different clients. In that case, the relationship is a bit more hidden: installment -> loan -> order, but it would be desirable to view the associated order from that installment in a modal, reusing
ViewOrderAction, for example.Beta Was this translation helpful? Give feedback.
All reactions