Route [pdfa] not defined url(fn(Applicant $record): string => route('pdfa', $record))
In short words: How do i have to create a link from an Action in a Table to a new created page (all in Admin Panel)? The new created page url already works! But i cant get the link from the action get working. And i need the record id in the new page.
Details:
In ApplicantResource.php i have created in the table:
And:
In app/Filament/Resources/ApplicantResource/Pages/PdfApplicant.php i have:
What do i miss? I get the error Route [pdfa] not defined. ☹️
3 Replies
ApplicantResource::getUrl('pdfa')
try
ResourceName::getUrl('pdfa', ['record' => $record])
anywhere
it will generate the route similar to route()@z3d0x and @Dan Harrin 🤪 Thank you very much It works now so far with:
BUT how can i replace the 60 please with the id variable. $record is throwing the error: ErrorException
PHP 8.1.15
10.3.3
Undefined variable $record
@z3d0x @Dan Harrin Thank you very much!! I resolved it now with your help!
The correct way seems to be:
php`