Class 'App\Nova\Dasboards\HtmlCard' Not Found
Closed this issue · 1 comments
Aontaigh commented
I get the error above as can be seen in the title and this is the code:
<?php
namespace App\Nova\Dashboards;
use Laravel\Nova\Dashboard;
use App\Nova\Metrics\UserDashboard\NewUsersToday;
use App\Nova\Metrics\UserDashboard\NewUsersWeek;
use App\Nova\Metrics\UserDashboard\NewUsersMonth;
use App\Nova\Metrics\UserDashboard\UserTotal;
use App\Nova\Metrics\UserDashboard\UserLoginTrendLine;
use App\Nova\Cards\UserDashboard\MostActiveUsers;
use App\Nova\Cards\UserDashboard\LeastActiveUsers;
class UserStatistics extends Dashboard
{
/**
* Get the displayable name of the dashboard.
*
* @return string
*/
public static function label()
{
return 'User Insights';
}
/**
* Get the cards for the dashboard.
*
* @return array
*/
public function cards()
{
return [
(new NewUsersToday)->width('1/4'),
(new NewUsersWeek)->width('1/4'),
(new NewUsersMonth)->width('1/4'),
(new UserTotal)->width('1/4'),
(new UserLoginTrendLine)->width('1/2'),
(new \Rocramer\MatomoAnalytics\Cards\VisitLength())->width('1/2'),
(new MostActiveUsers())->width('1/2'),
(new LeastActiveUsers())->width('1/2'),
(new HtmlCard())->width('1/3')->html('<h1>Hello World!</h1>')->center(true),
];
}
I'm assuming the package needs to be imported via a use statement at the top but there is not example on how to do so.
alies-dev commented
yes, this is missing import issue:
use IDF\HtmlCard\HtmlCard;
it's missing in the example just to visually simplify an example, we'll keep it as is