Download the PHP package eloquent-works/rating-kit without Composer
On this page you can find all versions of the php package eloquent-works/rating-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eloquent-works/rating-kit
More information about eloquent-works/rating-kit
Files in eloquent-works/rating-kit
Package rating-kit
Short Description A comprehensive Laravel rating engine for players, teams, multiplayer competitions, seasons, leaderboards, rating history, and pluggable rating algorithms.
License MIT
Informations about the package rating-kit
Laravel RatingKit ๐
Laravel RatingKit is a comprehensive, extensible rating engine for Laravel applications.
It supports 1v1, 2v2, 3v3, arbitrary N-vs-N team matches, free-for-alls, and competitions containing multiple teams. Ratings can be isolated by game, variant, queue, time control, season, region, or any custom pool.
โจ Features
- Fourteen bundled rating algorithms
- Any number of players per team
- Any number of teams per match
- Free-for-all and ranked-placement results
- Draws and tied ranks
- Weighted participation and substitutes
- Polymorphic
HasRatingstrait for users, teams, bots, clans, and other models - Model helpers for current ratings, statistics, ranks, histories, matches, and adjustments
- Separate rating pools
- Seasonal ratings
- Provisional ratings
- Rating deviation and volatility
- Rating floors and ceilings
- Win, draw, loss, and streak statistics
- Rating histories and audit trails
- Safe rollback of the latest match
- Idempotent external match IDs
- Direction-aware recurring inactivity decay
- Leaderboards, shared ranks, and conservative leaderboards
- Persistent leaderboard snapshots
- Match outcome prediction and match-quality scoring
- Pool statistics including average, median, minimum, and maximum
- Manual rating adjustments and resets
- Custom Eloquent models and table names
- Numeric, UUID, and ULID rateable model keys
- Per-match algorithm option snapshots
- Pluggable custom algorithms
- Transactional writes and row locking
- Lifecycle events
- Artisan installation, decay, snapshot, and season commands
- PHPUnit, PHPStan, Pint, and GitHub Actions support
๐งฎ Bundled Algorithms
| Key | Algorithm | Typical use |
|---|---|---|
elo |
Elo | General head-to-head and team competition |
elo_mov |
Margin-of-victory Elo | Score-based sports and games |
fide |
FIDE-style Elo | Chess-style rating pools |
uscf |
USCF-style Elo | Development-sensitive chess ratings |
glicko |
Glicko | Ratings with uncertainty |
glicko2 |
Glicko-2 | Uncertainty and volatility tracking |
weng_lin |
Weng-Lin / OpenSkill-style | Bayesian team and multiplayer ratings |
bradley_terry |
Bradley-Terry | Pairwise comparison models |
plackett_luce |
Plackett-Luce | Ordered multi-team and free-for-all results |
thurstone_mosteller |
Thurstone-Mosteller | Gaussian performance modeling |
dwz |
DWZ-style | Development-sensitive chess ratings |
egf |
EGF-style | Go-style rating adaptation |
ingo |
Ingo-style | Lower-is-stronger historical rating systems |
fifa |
FIFA-style Elo | Importance-weighted team competition |
Federation-named drivers are configurable practical adaptations. They are not claims of certification by the named federation.
๐ Installation
Install the package through Composer:
Publish the configuration and migrations, then migrate:
Add HasRatings to every model that can receive a rating:
The trait gives the model polymorphic rating relationships and convenient helpers:
A user can own independent ratings for every pool, algorithm, and season. See the full HasRatings guide.
โก One Player vs One Player
Record a draw:
๐ฅ Two Players vs Two Players
๐ก๏ธ Three Players vs Three Players
The same API supports 4v4, 5v5, 10v10, or any other team size.
๐ Multiple Teams in One Match
Teams may share a rank to represent a tie.
๐ฅ Free-for-All Results
โ๏ธ Weighted Participants
Use weights for substitutes, partial participation, handicaps, or unequal contribution:
๐๏ธ Separate Rating Pools
The same user can hold independent ratings:
Pools work well for:
- Different games
- Variants
- Time controls
- Ranked and casual queues
- Team sizes
- Regions
- Platforms
- Tournament circuits
๐ Seasons
Closing a season automatically captures a final leaderboard for every algorithm used during that season.
๐ Leaderboards
Use a conservative score based on rating uncertainty:
Competitors with the same score share the same competition rank. Retrieve one competitor's rank:
๐ฎ Match Predictions
The result contains a normalized estimated winning share for each team.
Measure how balanced the proposed match is on a scale from 0.0 to 1.0:
๐ Pool Statistics
The result includes total, established, and provisional counts together with average, median, minimum, and maximum ratings.
๐งพ Rating History
Every history record can preserve:
- Rating before and after
- Rating deviation before and after
- Volatility before and after
- Match ID
- Adjustment reason
- Custom metadata
โฉ๏ธ Rollback and Voiding
The latest match for every participant can be safely voided:
RatingKit refuses an unsafe rollback when one of the participants already has a later result.
๐ ๏ธ Manual Adjustments
Manual changes are written to rating history.
๐ค Inactivity Decay
Decay is disabled by default. When enabled, eligible ratings are adjusted once per configured period after the inactivity threshold. Higher-is-better algorithms move down toward the configured minimum; lower-is-better algorithms move up toward the configured maximum.
๐งฉ Custom Algorithms
Implement RatingAlgorithm and register it at runtime:
Or add it to config/rating-kit.php:
๐ฃ Events
RatingKit dispatches events for:
MatchRatedMatchVoidedRatingUpdatedRatingAdjustedSeasonClosedLeaderboardSnapshotted
Event dispatching can be disabled in configuration.
๐งฐ Artisan Commands
๐ Documentation
The complete documentation is available in docs/README.md.
- Installation
- Quick start
- Algorithms
- Team and multiplayer matches
- Pools and variants
- Seasons
- Leaderboards
- History and rollback
- Configuration
- Custom algorithms
- API reference
โ Supported Versions
- PHP 8.2+
- Laravel 12
- Laravel 13
๐งช Quality Checks
Or run the complete quality suite:
๐ Security
Please review SECURITY.md for responsible vulnerability reporting.
๐ค Contributing
See CODE_OF_CONDUCT.md.
๐ Credits
Built by Eloquent Works.
๐ License
Laravel RatingKit is open-source software licensed under the MIT License.
All versions of rating-kit with dependencies
illuminate/console Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/events Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0