I tried to add a widget on dashboard. It says in config\voyager.php

I paste it in just to add new widget. However, nothing appears neither error message.
I'll appreciate your help. Thank you!
Did you add in the dashboard settings too?
Hi fernandonicacio, yes I added it. But I got this error.


I don't know if I still need to do some complicated things to make my new widget appears.
You need to create a custom widgets, example: (I created a copy of PageDimmer and it worked correctly)
Thank you bro! I'll try this first!
Sorry bro still not working... tried to copy PostDimmer.php to app\Widgets\ then alter it to TravelDimmer.php, then I also changed the Post names.

Unfortunately, still got this error.

I'm a positive thinker. I believe I'm almost there, maybe I just miss some parts. lol
Use the 'eloquent way' to do the counting for your model:
Instead of:
$count = Voyager::model('Travel')->count();
You probably need to do:
$count = Travel::count();

@mhuijser just want to know, should I place the Travel.php inside the widget folder?
Still have an error here..

No, Your "Travel" class (Travel.php) should exists in the App-folder. I think it's enough to add use App\Travel; at the top of your TravelWidget.php, just below the namespace-declaration.
As i think Voyager may be something that is missing is to go into Voyager\src\widget and then create the layout of that TraverDimmer.php where the dimmers from layout will count the number of widget into that directory (src\widget) then create its widget on dashboard
Labels: help wanted, invalid
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
You need to create a custom widgets, example: (I created a copy of PageDimmer and it worked correctly)