Code Monkey home page Code Monkey logo

laravel-dashboard-tmb-tile's Introduction

TMB Bus tile for Laravel Dashboard.

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This tile can display the bus status for a given bus stop of Barcelona

img

This tile can be used on The Laravel Dashboard.

Installation

You can install the package via composer:

composer require dustycodecorp/laravel-dashboard-tmb-tile

Usage

NOTE: In order for this tile to work you will need the app_id and app_key from the TMB developer website the registration process is free and once you get the credentials you can ask for the information for as much stations as you want!.

In the dashboard config file, you must add this configuration in the tiles key.

// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'tmb' => [
            'app_id' => 'Get this from the TMB developer web stie',
            'app_key' => 'Get this from the TMB developer web site',
            'refresh_interval_in_seconds' => 60,
            'stations' => [
                1103,
                1208
            ]
        ]  
    ]   
];

In app\Console\Kernel.php you should schedule the Dustycode\TmbTile\ListenForTmbUpdatesCommand 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 app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(Dustycode\TmbTile\ListenForTmbUpdatesCommand::class)->everyMinute();
}

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

<x-dashboard>
    <livewire:tmb-tile position="c1:c2" title="Pl. Catalunya - Portal de l'Àngel" stop-id="1103"/>
</x-dashboard>

The title attribute is optional

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.

laravel-dashboard-tmb-tile's People

Contributors

jeop10 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.