PHPackages                             tourze/lottery-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/lottery-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/lottery-bundle
=====================

一个功能完整的 Symfony 抽奖系统包，支持多种抽奖活动配置、奖池管理、概率控制等功能

0.0.2(11mo ago)01MITPHPPHP ^8.1CI failing

Since Jun 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/lottery-bundle)[ Packagist](https://packagist.org/packages/tourze/lottery-bundle)[ RSS](/packages/tourze-lottery-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (62)Versions (3)Used By (0)

Lottery Bundle
==============

[](#lottery-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/4919027ac93c40bf0cc8ff13371adec600a2600a656c1e91611a74ed088684bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f6c6f74746572792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lottery-bundle)
[![Total Downloads](https://camo.githubusercontent.com/0b52f74208c87e8981e39743d065d8989d7396f75b63484c9cb8641377c26b0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f6c6f74746572792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lottery-bundle)
[![PHP Version](https://camo.githubusercontent.com/3a15ec8af50d01a784edc7499cd06eca274989f70b624f593b2dfa41820a3eb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f6c6f74746572792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lottery-bundle)
[![License](https://camo.githubusercontent.com/f06038ed4f31ae5319b721d5822272705b3365546d13be93daaf3ddd9959e39b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f6c6f74746572792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lottery-bundle)
[![Build Status](https://camo.githubusercontent.com/1cfa25daaee22ee8d87a64da5ba0129a17b18ff5c81cf1cb9eb51c4f808bf6d4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f75727a652f7068702d6d6f6e6f7265706f2f746573742e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/tourze/php-monorepo/actions)
[![Coverage](https://camo.githubusercontent.com/6ce0146325478eb7cebae4cc6139b2af2c161735dd0e3c6ff6802f2c5a708179/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f7068702d6d6f6e6f7265706f3f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/php-monorepo)

A comprehensive lottery system bundle for Symfony applications featuring multiple lottery types, advanced prize pool management, chance control, and automated prize distribution.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
    - [Requirements](#requirements)
    - [Install via Composer](#install-via-composer)
- [Quick Start](#quick-start)
    - [Bundle Registration](#bundle-registration)
    - [Database Setup](#database-setup)
    - [Configuration](#configuration)
- [Console Commands](#console-commands)
- [JSON-RPC API](#json-rpc-api)
- [System Architecture](#system-architecture)
- [Event System](#event-system)
- [Advanced Usage](#advanced-usage)
    - [Custom Event Subscribers](#custom-event-subscribers)
    - [Expression Language](#expression-language)
    - [External Integration](#external-integration)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **Multiple Lottery Types** - Support for wheel, grid, slot machine, and on-site lotteries
- **Advanced Prize Pool Management** - Multi-pool system with configurable probabilities and constraints
- **Intelligent Chance Management** - User chances with expiration tracking and status control
- **Automated Prize Distribution** - Automatic prize sending with consignee management
- **Admin Interface** - Complete EasyAdmin integration for lottery management
- **Responsive H5 Frontend** - Mobile-optimized lottery interface with multiple themes
- **Event-Driven Architecture** - Customizable event system for business logic extension
- **JSON-RPC API** - RESTful API endpoints for external system integration
- **Cron Job Integration** - Automated background tasks for maintenance and processing
- **Expression Language** - Flexible configuration with dynamic rule evaluation
- **Concurrent Safety** - Database-level locking for high-concurrency scenarios

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP 8.1 or higher
- Symfony 7.3 or higher
- Doctrine ORM 3.0 or higher
- MySQL 5.7+ or PostgreSQL 10+
- Redis (recommended for caching)

### Install via Composer

[](#install-via-composer)

```
composer require tourze/lottery-bundle
```

Quick Start
-----------

[](#quick-start)

```
