LaravelPackages.net
Acme Inc.
Toggle sidebar
jonlynch/laravel-dashboard-uk-weather-tile

A package to add UK Met Office weather forecast tiles to Laravel Dashboard

41
0
v1.2
About jonlynch/laravel-dashboard-uk-weather-tile

jonlynch/laravel-dashboard-uk-weather-tile is a Laravel package for a package to add uk met office weather forecast tiles to laravel dashboard. It currently has 0 GitHub stars and 41 downloads on Packagist (latest version v1.2). Install it with composer require jonlynch/laravel-dashboard-uk-weather-tile. Discover more Laravel packages by jonlynch or browse all Laravel packages to compare alternatives.

Last updated

A short description of the tile

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A weather forecast tile powered by Met Office data.

This tile can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

$ composer require jonlynch/laravel-dashboard-uk-weather-tile

Usage

In your dashboard view you use the livewire:uk-weather-tile component. You may add more than one weather forecast by adding more locations.

<x-dashboard>
    <livewire:uk-weather-tile position="a1:a2" location-name="St Bees"/>
    <livewire:uk-weather-tile position="b1:b2" location-name="Scafell Pike"/>
</x-dashboard>

Add the config to the tiles sections of your config/dashboard.php

// in config/dashboard.php

return [
    // ...
    tiles => [
        'ukweather' => [
            'apikey' => env('MET_OFFICE_API_KEY'),
            'locations' => [
                'St Bees' => [
                    'lat' => '54.4891',
                    'lon' => '-3.6080',
                ],
                'Scafell Pike' => [
                    'lat' => '54.4543',
                    'lon' => '-3.2115'
                ]
            ],
            'refresh_interval_in_seconds' => 600,
        ]
    ]

In app\Console\Kernel.php you should schedule the JonLynch\UkWeatherTile\Commands\FetchMetOfficeDataCommand to run every 30 minutes.

// in app\Console\Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command(\JonLynch\UkWeatherTile\Commands\FetchMetOfficeDataCommand::class)->everyThirtyMinutes();

}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History Chart