Show orderitems associated with orders
I'm currently working on a project where I have two main models: Order and OrderItem, with Order containing many OrderItems. In the Filament admin panel, I'm trying to implement a feature within the Order resource where I can click an action button for an order to view all its associated order items in a table.
I attempted to create a custom action in the Order resource to achieve this, hoping to navigate to a view or page where I see a table listing all the OrderItems associated with that specific Order. Here's the code snippet I've used:
use Filament\Pages\Actions\Action;
Action::make('view Order Id')
->url(fn (): string => OrderItemResource::getUrl('view', ['record' => $this->order->id]));
0 Replies