GithubHelp home page GithubHelp logo

victoravelar / laravel-dashboard-football-data-advanced Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.12 MB

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

License: MIT License

Blade 44.41% PHP 51.62% Dockerfile 3.97%
hacktoberfest laravel laravel-dashboard laravel-dashboard-tile

laravel-dashboard-football-data-advanced's Introduction

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 [email protected] instead of using the issue tracker.

Credits

License

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

laravel-dashboard-football-data-advanced's People

Contributors

cdterry87 avatar victoravelar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

laravel-dashboard-football-data-advanced's Issues

Fix typo on ServiceProvider

Description

There is a typo that prevents laravel from correctly resolving the location of the view files.

Expected result

The path to the views should be correct on Avelar\FootballDataAdvanced\ServiceProvider

Fix configuration key

Description

The existing configuration key exposed in the documentation doesn't match the one used in the code.

Expected change

The documentation should use api_key instead of api-key

Fix data values on LeagueStandingsTileComponent

Description

The way data is passed down to the livewire view component is not correct.

Expected behaviour

Rather than using array merge, pass a single array with the correct array key values.

// expected keys (values are just descriptive).
return [
'refreshIntervalInSeconds' => $value,
'data' => $arrayOfValues,
'priorityList' => $arrayOfPriorityItemsFromConfig
];

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.