This package provides a Filament widget to show the Dutch forecast from Buienradar. The package is based on the Buienradar PHP package.
You can install the package via composer:
composer require baspa/filament-buienradar-widget
You can publish the config file with:
php artisan vendor:publish --tag="buienradar-widget-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="buienradar-widget-views"
This is the contents of the published config file:
return [
'station' => MeasuringStation::VOLKEL,
'show' => [
'temperature' => true,
'weather_description' => true,
'wind_speed' => true,
'stationname' => true,
'humidity' => true,
'last_update' => true,
],
];
To check what stations are available, you can check the MeasuringStation
enum in the Buienradar package.
Add the widget to your Filament page via your provider:
use Baspa\FilamentBuienradarWidget\Widgets\FilamentBuienradarWidgetPlugin;
// ...
->plugin(FilamentBuienradarWidgetPlugin::make())
And optionally add the widgets to your page:
use Baspa\FilamentBuienradarWidget\Widgets\ForecastReportWidget;
use Baspa\FilamentBuienradarWidget\Widgets\ForecastLongTermWidget;
use Baspa\FilamentBuienradarWidget\Widgets\ForecastShortTermWidget;
use Baspa\FilamentBuienradarWidget\Widgets\ForecastForStationWidget;
// ...
public function getHeaderWidgetsColumns(): int
{
return 12;
}
public function getHeaderWidgets(): array
{
return [
ForecastForStationWidget::make([
'width' => 4, // Define the width of the widget
]),
ForecastShortTermWidget::make([
'width' => 4,
]),
ForecastLongTermWidget::make([
'width' => 4,
]),
ForecastReportWidget::make([
'width' => 12,
]),
];
}
To set the station per widget, you can pass the station in the widget. This will override the station set in the config.
use Baspa\Buienradar\Enum\MeasuringStation;
// ...
ForecastForStationWidget::make([
'station' => MeasuringStation::VOLKEL,
])
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.