kehet/laravel-dashboard-hsl-tile

HSL tile for Spatie Laravel Dashboard

1.2.0 2021-11-18 16:39 UTC

This package is auto-updated.

Last update: 2024-10-18 23:09:09 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Screenshot

This tile show HSL (Helsinki Regional Transport Authority) data for given stops

This tile can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

composer require kehet/laravel-dashboard-hsl-tile

In app\Console\Kernel.php you should schedule the Kehet\HSLTile\FetchDataFromApiCommand to run. You can let in run every minute if you want. You could also run is less frequently if you fast updates on the dashboard aren't that important for this tile.

In the dashboard config file, you must add this configuration in the tiles key. The value belgian_trains should be an array of which each value is array with keys departure, destination and label.

// in config/dashboard.php

return [
    'tiles' => [
        'hsl' => [
            'stops' => [
                [
                    'id' => 'HSL:1020602',
                    'title' => null,
                ],
            ],
            'refresh_interval_in_seconds' => 60,
        ],
    ],
];

To publish required CSS file, you must publish assets

php artisan vendor:publish --provider="Kehet\HSLTile\HSLTileServiceProvider"

Usage

In your dashboard view you use the livewire:hsl-tile component.

<x-dashboard>
    <livewire:hsl-tile position="a1:a3" />
</x-dashboard>

Testing

composer test

Changelog

1.0.0 - 2021-11-16

  • initial release

Credits

License

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