How can I pass a URL to Widget on panel initialisation?
I want to add quicklinks to my dashboard and have created a custom widget to do so.
This is the code I have so far
in AdminPanelProvider.php
But when I try this code I get this error Call to a member function generateRouteName() on null
https://flareapp.io/share/87nLqw4m#top
I am guessing it because the ::getUrl doesn't work to the panel is initalised is there any way to fix or get around this.
any help appreciated thanks
Flare
Call to a member function generateRouteName() on null - The error occurred at http://localhost:8000/admin
3 Replies
Any ideas on how to do this?
Try like this
'url' => (fn () => AddPointsByStudent::getUrl())
or just pass the string 'url' => '/admin/student..url'
This error typically occurs when Filament cannot find the correct panel configuration. We need to specify the panel to which the resource belongs. In Filament 3, each resource belongs to a specific panel.
In my case I use something like this:
Or you can do this too: