Voyager: Dashboard Widget Problem

Created on 26 Jun 2017  路  11Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.24
  • Voyager Version: 0.11.14
  • PHP Version:5.6.8
  • Database Driver & Version:

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

dimmer

I paste it in just to add new widget. However, nothing appears neither error message.
I'll appreciate your help. Thank you!

invalid question

Most helpful comment

You need to create a custom widgets, example: (I created a copy of PageDimmer and it worked correctly)

fgsdafasd

All 11 comments

Did you add in the dashboard settings too?

sdgsdfasfd
dfghdsf

Hi fernandonicacio, yes I added it. But I got this error.

dimmer2

dimmer3

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)

fgsdafasd

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.
dimmer7

Unfortunately, still got this error.

dimmer5

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();

dimmer10

@mhuijser just want to know, should I place the Travel.php inside the widget folder?

Still have an error here..

dimmer11

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.

Was this page helpful?
0 / 5 - 0 ratings