LaravelPackages.net
Acme Inc.
Toggle sidebar
kayschima/laravel-dashboard-footballdata-standings-tile

A tile for Laravel Dashboard that displays football standings of different leagues

90
0
1.0.1
About kayschima/laravel-dashboard-footballdata-standings-tile

kayschima/laravel-dashboard-footballdata-standings-tile is a Laravel package for a tile for laravel dashboard that displays football standings of different leagues. It currently has 0 GitHub stars and 90 downloads on Packagist (latest version 1.0.1). Install it with composer require kayschima/laravel-dashboard-footballdata-standings-tile. Discover more Laravel packages by kayschima or browse all Laravel packages to compare alternatives.

Last updated

A tile for Laravel Dashboard that displays football standings of different leagues and actual football livescores

Latest Version on PackagistTotal Downloads

This tile can used on the Laravel Dashboard to display standings from www.football-data.org.

License

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

Installation

You can install the tile via composer:

composer require kayschima/laravel-dashboard-footballdata-standings-tile

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

Sign up at https://www.football-data.org/ to obtain FOOTBALLDATA_API_KEY.

Set FOOTBALL_LEAGUE to a league shortcut of the football-data.org service (e.g. BL1 or PL).

// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'footballstandings' => [
            'footballdata_api_key' => env('FOOTBALLDATA_API_KEY'),
            'football_league' => env('FOOTBALL_LEAGUE'),
        ]
    ],
];

In app\Console\Kernel.php you should schedule

  • the Kayschima\FootballStandingsTile\Commands\FetchFootballStandingsDataCommand and
  • the Kayschima\FootballStandingsTile\Commands\FetchFootballLiveResultsDataCommand

to run every minute.

// in app/console/Kernel.php

use Kayschima\FootballStandingsTile\Commands\FetchFootballStandingsDataCommand;
use Kayschima\FootballStandingsTile\Commands\FetchFootballLiveResultsDataCommand;

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(FetchFootballStandingsDataCommand::class)->everyMinute();
    $schedule->command(FetchFootballLiveResultsDataCommand::class)->everyMinute();
}      

Views

In your dashboard views you use

  • the livewire:football-standings-tile component and/or
  • the livewire:football-live-results-tile component.

An optional $highlight-attribute to the livewire:football-standings-tile triggers a simple highlighting of e.g. the local or favourite team what is expected to be a common use case for the tile.

For simplicity, this commit uses the id of the team, specific to every competition -- "4" in this case for BVB @ 1. Bundesliga.

<x-dashboard>
    <livewire:football-standings-tile position="a1" highlight="4" />
    <livewire:football-live-results-tile position="b1"/>
</x-dashboard>

Customizing the views

php artisan vendor:publish --provider="Kayschima\FootballStandingsTile\FootballStandingsTileServiceProvider" --tag="dashboard-football-standings-tile-views"

Star History Chart