How to open custom page from relation manager

I can open page from a resource row with an Action in
table->actions([Tables\Actions\Action::make('Stats')
->url(fn(Client $record): string => self::getUrl('stats-monthly', ['record' => $record]))
table->actions([Tables\Actions\Action::make('Stats')
->url(fn(Client $record): string => self::getUrl('stats-monthly', ['record' => $record]))
and
public function getPages(): array
{
return [
'stats-monthly' => Pages\MonthlyStats::route('/{record}/monthly-stats'),
public function getPages(): array
{
return [
'stats-monthly' => Pages\MonthlyStats::route('/{record}/monthly-stats'),
But how to do this in ResourceManager? I want to open a Custom page from an action in in the InboxRelationManager which is on the Client.
->actions([
Tables\Actions\Action::make('work')
->url(fn(CampaignContact $record): string => self::getUrl('work', ['record' => $record])),
->actions([
Tables\Actions\Action::make('work')
->url(fn(CampaignContact $record): string => self::getUrl('work', ['record' => $record])),
and
public function getPages(): array
{
return [
'work' => ManageThread::route('/work'),
public function getPages(): array
{
return [
'work' => ManageThread::route('/work'),
. and I get error \InboxRelationManager::getUrl does not exist
2 Replies
Povilas K
Povilas K4w ago
Not entirely sure but instead of self:: you could use the class name of the original resource. We wrote about various examples here: https://laraveldaily.com/post/filament-get-urls-route-names-resources-pages
ddoddsr
ddoddsrOP3w ago
Thanks I will take a look... I have it working mostly. the url comes out like this: site.io/clients/5/manage-thread where the "5" is the thread id. It does open the page and pass the thread id .. In the RelationManager it opens on a row action. I have to put the getPages entry in the ClientResource. if I put it in the RelationManager, I get an error the getPages() does not exist on the relationManager class. I tried a few things but it comes back to getPages()
Want results from more Discord servers?
Add your server