F
Filament10mo 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;
}
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:
```php ViewAction::make() ->url(function ($record) { return route('filament.admin.resources.orders.view', $record); }),...
Jump to solution
2 Replies
vas
vasOP10mo ago
as you see when i click the order in the relation manager table it opens a edit modal
No description
No description
No description
No description
Solution
vas
vas10mo ago
ViewAction::make()
->url(function ($record) {
return route('filament.admin.resources.orders.view', $record);
}),
ViewAction::make()
->url(function ($record) {
return route('filament.admin.resources.orders.view', $record);
}),
Want results from more Discord servers?
Add your server