feat: 添加 Laravel Reverb 支持,更新 .env.example 文件以配置 WebSocket,增强彩票调度功能,更新 API 路由以支持期号管理与结果发布

This commit is contained in:
2026-05-09 17:40:49 +08:00
parent 781cf10928
commit aeaf124096
42 changed files with 3886 additions and 5 deletions

View File

@@ -41,6 +41,34 @@ php artisan boost:install
Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices.
## 本地开发(可复制启动)
**本仓库根目录**(即含 `artisan``lotterLaravel` 目录)开 **3 个终端**,每段整段复制即可。若已用 Herd / Valet / Sail / 自有 Web 服务器指到 `public`,可不跑「终端 1」。
**前置(首次)**`cp .env.example .env``composer install``php artisan key:generate``php artisan migrate`(及你的库表/种子)。
**终端 1 — HTTP API**
```bash
php artisan serve
```
**终端 2 — WebSocket`.env``BROADCAST_CONNECTION=reverb` 时必开)**
```bash
php artisan reverb:start
```
**终端 3 — 任务调度(`draw.countdown` 每秒 + `lottery:draw-tick` 每分钟)**
```bash
php artisan schedule:work
```
> 仅用系统 cron 每分钟执行一次 `schedule:run` **无法覆盖「每秒」的 `lottery:hall-countdown`**,开发大厅实时倒计时时请用 `schedule:work`(或生产上等价常驻调度进程)。
只做 HTTP / 降级轮询、不测 WebSocket 时:**终端 2、3 可先不开**;要完整大厅 WS**三项都开**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).