F
Filamentβ€’2y ago
Vp

Unable to find component: [] in Custom Dashboard

I've follow https://filamentphp.com/docs/2.x/admin/dashboard/getting-started#customizing-the-dashboard-page and I create my own dashboard page. Now I want to display some stats and I follow this https://filamentphp.com/docs/2.x/admin/dashboard/stats#getting-started and using this link I try to display my widgets https://filamentphp.com/docs/2.x/admin/pages/widgets and put inside getHeaderWidgets() But I got error Unable to find component: [] What should be gone wrong? Edit: After using getHeaderWidgets() the error come, If I don't use then I can see my page without error
7 Replies
Yuut4
Yuut4β€’2y ago
I don't know if it will help, but in your config filament.php, you have the widgets there, maybe you have to put them there for him to identify them and use them in that function. but it shouldn't be necessary to do this by logic
Vp
VpOPβ€’2y ago
If I include inside config then the error is gone, but my stats cannot display in Dashboard page.. getHeaderWidgets() and getFooterWidgets() seem not working
Yuut4
Yuut4β€’2y ago
did you do the function this way? protected function getHeaderWidgets(): array { return [yorwidget]; }
Vp
VpOPβ€’2y ago
Yes.. let me check in other custom pages My bad, import wrong class.. πŸ˜‚ I need to sleep
Yuut4
Yuut4β€’2y ago
hahaha this happens a lot xD
Vp
VpOPβ€’2y ago
Thanks for your help @yuut4
Yuut4
Yuut4β€’2y ago
I didn't help much but thanks, stick with it
Want results from more Discord servers?
Add your server