Skip to content

Laravel dashboard tiles to display matches, results, standings and more football data stats.

License

Notifications You must be signed in to change notification settings

VictorAvelar/laravel-dashboard-football-data-advanced

Repository files navigation

A collection of tiles to display football data.

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Laravel dashboard tiles to display matches, results, standings and more football data stats.

This tile can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

composer require victoravelar/laravel-dashboard-football-data-advanced

Configuration

// in config/dashboard.php

return [
    // other settings
    'tiles' => [
        // other tiles ...
        'football_data_advanced' => [
            /*
            |--------------------------------------------------------------------------
            | Football-data.org API KEY
            |--------------------------------------------------------------------------
            |
            | In order to fetch the data an API key is required, get yours at 
            | https://www.football-data.org/client/register.
            | The API is provided in a FREMIUM model thus the information to be
            | displayed is limited by your own API plan.
            |
            */
            'api_key' => env('FOOTBALL_DATA_API_KEY', ''),

            /*
            |--------------------------------------------------------------------------
            | Future lookup limit.
            |--------------------------------------------------------------------------
            |
            | Sets the limit to look forward for upcoming matches, the max. suggested
            | value is 1 week as the space for displaying is limited and most of the
            | values will not fit the available tile space.
            |
            | The value must be a strtotime valid string without sign.
            |
            | See: https://www.php.net/manual/en/function.strtotime.php
            |
            */
            'future' => '2 days',

            /*
            |--------------------------------------------------------------------------
            | Past lookup limit.
            |--------------------------------------------------------------------------
            |
            | Sets the limit to look backwards for resutls, the max. suggested
            | value is 1 week as the space for displaying is limited and most of the
            | values will not fit the available tile space.
            |
            | The value must be a strtotime valid string without sign.
            |
            | See: https://www.php.net/manual/en/function.strtotime.php
            |
            */
            'past' => '3 days',
            
            /*
            |--------------------------------------------------------------------------
            | Competitions of interest.
            |--------------------------------------------------------------------------
            |
            | The list of competitions that you are interested in.
            |
            | The values for all the competitions can be found here:
            | https://docs.football-data.org/general/v4/lookup_tables.html#_league_codes
            |
            | The leagues available in the free tier are the following: Champions League,
            | Primeira Liga, Premier League, Eredivisie, Bundesliga, Ligue 1, Serie A,
            | La Liga, Championship, Serie A BR, Worldcup, Euro.
            |
            */
            'competitions' => ['PD', 'PL', 'FL1', 'BL1', 'CL', 'SA'],

            /*
            |--------------------------------------------------------------------------
            | Priority Football teams.
            |--------------------------------------------------------------------------
            |
            | A list of the teams you consider a priority across the tracked competitions.
            |
            | You must use the team acronym, ex. use `PSG` for Paris St. Germain.
            |
            */
            'priority' => [
                'FCB',
                'MCI',
                'LIV',
                'PSG',
                'RBL',
            ],
        ],
    ],
];

Usage

This package contains multiple tiles to display information from Football-data.org, the usage will be broken down per tile.

Upcoming matches

This tile displays upcoming football matches from the leagues you selected in dashboard.tiles.football_data_advanced.competitions.

In your dashboard view you use the livewire:fda-upcoming component.

<x-dashboard>
    <livewire:fda-upcoming position="a1" />
</x-dashboard>

Example

Upcoming matches

Match results

This tile displays football matches resutls from the leagues you selected in dashboard.tiles.football_data_advanced.competitions.

In your dashboard view you use the livewire:fda-results component.

<x-dashboard>
    <livewire:fda-results position="a1" />
</x-dashboard>

Example

Upcoming matches

League standings

This tile displays the standings for one of your selected leagues, you need to use the league code as parameter for the component.

In your dashboard view you use the livewire:fda-results component.

<x-dashboard>
    <livewire:fda-standings position="a1" competition="PL"/>
</x-dashboard>

Example

Upcoming matches

Sample dashboard

<x-dashboard>
    <livewire:fda-standings position="a1" competition="PL"/>
    <livewire:fda-results position="b1" /> 
    <livewire:fda-upcoming position="c1"/>
</x-dashboard>

Screenshot

Upcoming matches

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 deltatuts@gmail.com instead of using the issue tracker.

Credits

License

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