| Install | |
|---|---|
composer require laravilt/widgets |
|
| Latest Version: | 1.0.2 |
| PHP: | ^8.3|^8.4 |

Complete dashboard widget system with stats, charts, and custom widgets for Laravilt. Display key metrics and data visualizations with beautiful, responsive widgets.
| Widget | Description |
|---|---|
StatsOverviewWidget |
Multiple stats in responsive grid |
LineChartWidget |
Line/area charts with trends |
BarChartWidget |
Vertical/horizontal bar charts |
PieChartWidget |
Pie and doughnut charts |
use Laravilt\Widgets\StatsOverviewWidget;
use Laravilt\Widgets\Stat;
StatsOverviewWidget::make()
->columns(4)
->stats([
Stat::make('Revenue', fn() => '$' . number_format(Order::sum('total'), 2))
->description('+12% from yesterday')
->descriptionIcon('TrendingUp', 'success')
->icon('DollarSign')
->color('success'),
Stat::make('Orders', fn() => Order::count())
->description('Completed today')
->icon('ShoppingCart')
->color('primary')
->chart('bar', [8, 12, 15, 18, 22], 'primary'),
])
->polling(30); // Refresh every 30 seconds
use Laravilt\Widgets\LineChartWidget;
LineChartWidget::make(
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
datasets: [[
'label' => 'Sales',
'data' => [4500, 5200, 4800, 6100, 5900],
'borderColor' => 'rgb(34, 197, 94)',
]]
)
->heading('Revenue Trend')
->curved()
->fill()
->height(350);
use Laravilt\Widgets\PieChartWidget;
PieChartWidget::make(
labels: ['Featured', 'Regular'],
data: [150, 350]
)
->heading('Product Distribution')
->doughnut()
->showLegend()
->showPercentage();
composer require laravilt/widgets
php artisan make:widget UserStatsWidget --stats
php artisan make:widget SalesChartWidget --chart=line
php artisan make:widget RevenueChartWidget --chart=bar
php artisan make:widget CategoryChartWidget --chart=pie
The MIT License (MIT). Please see License File for more information.