F
Filament5mo ago
o.m

getPages not working on Custom Page

I am trying to redirect a View Custom page to another Custom Page. So I added this on Notificaiton custom Page
public static function getPages() : array
{
return [
'edit' => EditNotification::route('/{slug}/edit'),
];
}
public static function getPages() : array
{
return [
'edit' => EditNotification::route('/{slug}/edit'),
];
}
The EditNotification is another custom page where I wanted to show specific datas However I do not see the route on phpartisan list causing me to have Route [filament.pages.notifications.edit] not defined.
No description
Solution:
Was able to solve it by using this on custom page protected static ?string $slug = 'notification/{slug}/edit';
Jump to solution
4 Replies
o.m
o.mOP5mo ago
On the view of Notification custom page this is how I try to redirect to another custom page.
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-400 hover:underline">
<a href="{{ route('filament.pages.notifications.edit', ['slug' => $notification['slug']]) }}">{{ $notification['label'] }}</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-400 hover:underline">
<a href="{{ route('filament.pages.notifications.edit', ['slug' => $notification['slug']]) }}">{{ $notification['label'] }}</a>
</td>
Alex-Elivate
Alex-Elivate5mo ago
Why don't you have a route to the page? did you add it to the resources getPages? https://filamentphp.com/docs/3.x/panels/resources/custom-pages#overview
o.m
o.mOP4mo ago
I do not have resources, only custom pages
Solution
o.m
o.m4mo ago
Was able to solve it by using this on custom page protected static ?string $slug = 'notification/{slug}/edit';

Did you find this page helpful?