Code Monkey home page Code Monkey logo

laravel-dashboard-stadtwerke-muenster-bus-tile's Introduction

A tile to display the next departures of busses in Münster (Germany)

Screenshot of Dashboard Tile

Total Downloads

This tile can be used on the Laravel Dashboard to display the next departure of busses from a bus station in Münster.

Installation

You can install the package via composer:

composer require pschocke/laravel-dashboard-stadtwerke-muenster-bus-tile

In the dashboard config file, you must add this configuration in the tiles key. The stations should contain an internal name for the station and all IDs of the bus stations that you want to display on one tile. You can add as many stations as you want.

You can find all stations and their ids here.

// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'muenster-bus' => [
            'stations' => [
                'ludgeri' => 4102102,
                'schulzentrum' => [4725102, 4725101],
                'Friedrich-Ebert-Platz' => 4357102
            ]
        ]
    ]
];

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

// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(\Pschocke\MuensterBusTile\FetchMuensterBusStationsCommand::class)->everyMinute();
}

Usage

In your dashboard view you use the livewire:citybikes-tile component. You need to specify the stations internal name defined in your config and a display name.

<x-dashboard>
    <livewire:muenster-bus-tile position="b2:b4" station="schulzentrum" name="Hiltrup Schulzentrum"/>
</x-dashboard>

Customizing the view

If you want to customize the view used to render this tile, run this command:

php artisan vendor:publish --provider="Pschocke\MuensterBusTile\MuensterBusTileServiceProvider" --tag="dashboard-muenster-bus-tile-views"

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

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.