F
Filament2y 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
Yuut42y 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
VpOP2y 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
Yuut42y ago
did you do the function this way? protected function getHeaderWidgets(): array { return [yorwidget]; }
Vp
VpOP2y ago
Yes.. let me check in other custom pages My bad, import wrong class.. 😂 I need to sleep
Yuut4
Yuut42y ago
hahaha this happens a lot xD
Vp
VpOP2y ago
Thanks for your help @yuut4
Yuut4
Yuut42y ago
I didn't help much but thanks, stick with it

Did you find this page helpful?