m-alsafadi/laravel-queue
最新稳定版本:1.1.0
Composer 安装命令:
composer require m-alsafadi/laravel-queue
包简介
Laravel Custom Queue System
README 文档
README
Laravel custom queue system.
Installation
- Use composer:
composer require m-alsafadi/laravel-queue
- Add to
.envfile:
LARAVEL_QUEUE_ENABLED=true LARAVEL_QUEUE_DISK=local LARAVEL_QUEUE_SINGLE_PROC=true LARAVEL_QUEUE_CACHE=false LARAVEL_QUEUE_LOG_CHANNEL=stack
- Add trait to your model (optional):
use \MAlsafadi\LaravelQueue\Traits\TLaravelQueueModel;
- Create job:
php artisan laravel:queue:job UserJob
- Modify
handlemethod in your job at\App\Jobs\UserJob - Start the worker:
- Via artisan command:
php artisan larave:queue:start
- Via file:
php laravel-queue
Publish config:
php artisan vendor:publish --provider=MAlsafadi\\LaravelQueue\\Providers\\LaravelQueueProvider
How to add job to queue:
- Via your job:
\App\Jobs\UserJob::addJob($model, $valid_at, $arguments, $name);
- Via your model:
\App\Models\User::find(1)->addJob(\App\Jobs\UserJob::class, $valid_at, $arguments, $name);
- Via Laravel Queue:
LaravelQueue::addJob($model, \App\Jobs\UserJob::class, $valid_at, $arguments, $name);
Info: Attribute
$nameis optional.
Commands:
- Laravel Queue Helper:
php artisan laravel:queue
- Create New Laravel Queue Job:
php artisan laravel:queue:job
- Start Laravel Queue Worker:
php artisan laravel:queue:start
License
The Laravel framework is open-sourced software licensed under the MIT license.
The Laravel Queue is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-13