tkachikov/laravel-pulse
最新稳定版本:2.0.6
Composer 安装命令:
composer require tkachikov/laravel-pulse
包简介
Settings commands for scheduling
README 文档
README
This package for setting commands in schedule.
DEPRECATED! MOVED TO: https://github.com/tkachikov/chronos
Installation
Require this package with composer using the following command
composer require tkachikov/laravel-pulse
Run Laravel pulse command for install:
php artisan pulse:install
Added Laravel pulse scheduler in app/Console/Kernel.php:
// ... use Tkachikov\LaravelPulse\Services\ScheduleService; // ... class Kernel extends ConsoleKernel { // ... protected function schedule(Schedule $schedule): void { app(ScheduleService::class)->schedule($schedule); } // ... }
Authorization
For authorization in production set statements in app/Providers/LaravelPulseServiceProvider, example:
// ... class LaravelPulseServiceProvider extends LaravelPulseApplicationServiceProvider { // ... protected function gate(): void { Gate::define('viewPulse', function ($user) { return $user->hasRole('admin'); }); } }
Usage
Visit route /route, example: localhost:8000/pulse
For testing
Run attributes
If you need off run command from Laravel Pulse dashboard (notRunInManual) or schedules (notRunInSchedule) set attributes:
For example all off:
// ... #[notRunInManual] #[notRunInSchedule] class TestCommand extends Command { // ... }
Logging and states
For logging command messages and set status added trait PulseRunnerTrait:
// ... class TestCommand extends Command { use PulseRunnerTrait; // ... }
Create schedules
Open your command and set params for it in Create schedule and save.

For off command click button edit, check to off Run and save:

Statistics
For calculate statistics run commands you must create schedule for pulse:update-metrics
License
This package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 76
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-15

