Download the PHP package canerdogan/laravel-leaderboard without Composer
On this page you can find all versions of the php package canerdogan/laravel-leaderboard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download canerdogan/laravel-leaderboard
More information about canerdogan/laravel-leaderboard
Files in canerdogan/laravel-leaderboard
Package laravel-leaderboard
Short Description Laravel leaderbord module that besides the all-time leaderboard supports also periodic leaderboards: daily, weekly, monthly options backed by Redis.
License MIT
Homepage https://github.com/canerdogan/laravel-leaderboard
Informations about the package laravel-leaderboard
Laravel Leaderboard
Laravel leaderboard module that supports both all-time leaderboards and periodic leaderboards (daily, weekly, monthly) backed by Redis.
Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
- Redis server
Installation
You can install the package via composer:
The package will automatically register its service provider.
Configuration
This package requires Redis to be configured in your Laravel application. Make sure you have the Redis configuration set up in your config/database.php
file:
Usage
Basic Usage
Periodic Leaderboards
The package supports daily, weekly, and monthly leaderboards. You need to enable them first:
Clearing Leaderboards
You can clear the leaderboards using the provided command:
Or programmatically:
Standalone Usage
You can also use the package without a full Laravel application. See the example in examples/standalone.php
.
Laravel Controller Example
For a complete example of how to use the package in a Laravel controller, see the example in examples/laravel-usage.php
.
Testing
License
The MIT License (MIT). Please see License File for more information.