A tile for Laravel Dashboard that shows real time public transport data from Stockholms Lokaltrafik.
You can install the package via composer:
composer require robbens/laravel-dashboard-sl
In your dashboard view you use the livewire:sl-tile
component.
<x-dashboard>
<livewire:sl-tile position="a1:a2" />
</x-dashboard>
Configure config/dashboard.php
[
// ...
'tiles' => [
'sl' => [
/**
* API key to SL Real-time information 4
*
* @link https://www.trafiklab.se/api/sl-realtidsinformation-4
*/
'api_key' => env('TRAFIKLAB_KEY'),
/**
* ID for the place for which the departures are to be collected, eg 9192 for Slussen.
* This ID can be found using the "SL Location Lookup Console".
*
* @link https://www.trafiklab.se/api/sl-platsuppslag/konsol
*/
'site_id' => 1079,
/**
* Optional label to show on the top of the tile.
*/
'site_label' => 'Odenplan',
/**
* Get departures within the desired time window. Where the
* time window is the number of minutes from now. Max 60.
*/
'time_window' => 60,
/**
* Transport modes limit.
*/
'buses' => [
'total_limit' => 5,
// Filter out early departures by minute. This is usually how long it takes to walk to the station.
'early_departures_limit' => 5,
],
'metros' => [
'total_limit' => 5,
'early_departures_limit' => null,
],
'trains' => false,
],
]
]
Schedule the command in app/Console/Kernel.php
.
protected function schedule(Schedule $schedule)
{
$schedule->command(Robbens\SlTile\FetchDataFromSLApiCommand::class)->everyMinute();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.