Skip to content

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

License

Notifications You must be signed in to change notification settings

Kehet/laravel-dashboard-hsl-tile

Repository files navigation

HSL public transport (Finland) tile for Laravel Dashboard

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published