F
Filament17mo ago
Matthew

White screen when trying to load a widget to a blade file

So I have a blade file and im trying to put load a widget within it. However, I get a blank screen and an error in the console. Any ideas?
<?php

namespace App\Filament\App\Widgets;

use Filament\Widgets\Widget;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class NewUserCount extends BaseWidget
{
protected static string $view = 'filament.app.widgets.new-user-count';

protected function getStats(): array
{
return [
Stat::make('Unique views', '192.1k'),
Stat::make('Bounce rate', '21%'),
Stat::make('Average time on page', '3:12'),
];
}
}
<?php

namespace App\Filament\App\Widgets;

use Filament\Widgets\Widget;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class NewUserCount extends BaseWidget
{
protected static string $view = 'filament.app.widgets.new-user-count';

protected function getStats(): array
{
return [
Stat::make('Unique views', '192.1k'),
Stat::make('Bounce rate', '21%'),
Stat::make('Average time on page', '3:12'),
];
}
}
Solution:
Ohh, i see. It should be made in Livewire directory
Jump to solution
2 Replies
Matthew
MatthewOP17mo ago
blade file:
<x-filament-widgets::widget>
<x-filament::section>
<div>
@livewire(\App\Filament\App\Widgets\NewUserCount::class)
</div>
</x-filament::section>
</x-filament-widgets::widget>
<x-filament-widgets::widget>
<x-filament::section>
<div>
@livewire(\App\Filament\App\Widgets\NewUserCount::class)
</div>
</x-filament::section>
</x-filament-widgets::widget>
Solution
Matthew
Matthew17mo ago
Ohh, i see. It should be made in Livewire directory
Want results from more Discord servers?
Add your server