FilamentF
Filament2y ago
vas

Accessing resource from resource manager link

hi i have an OrderResource and an OrdersRelationManager
the OrderResource has a view page that is displayed when clicked
i would like from the table view when i click the order from the relation manager view to take me to the actual OrderResource view page
Any tips on how to achieve this ? thanks
class OrdersRelationManager extends RelationManager
{
    protected static string $relationship = 'orders';

    public function form(Form $form): Form
    {
        return OrderResource::form($form);
    }

    public function table(Table $table): Table
    {
        return OrderResource::table($table);
    }

    public function isReadOnly(): bool
    {
        return false;
    }

    public function canCreate(): bool
    {
        return false;
    }
Solution
                    ViewAction::make()
                    ->url(function ($record) {
                        return route('filament.admin.resources.orders.view', $record);
                    }),
Was this page helpful?