ibrand/laravel-scheduling

ibrand的laravel调度。将调度拆分到每个包中。

v1.0.1 2020-03-09 07:34 UTC

This package is auto-updated.

Last update: 2024-09-16 14:30:53 UTC


README

安装

$ composer require ibrand/laravel-scheduling -vvv

如果你的Laravel版本低于5.5,你需要在config/app.phpproviders部分添加以下行:

iBrand\Scheduling\ServiceProvider::class,

用法

扩展Scheduling抽象类

use iBrand\Scheduling\Scheduling;

class YourSchedule extends Scheduling {

    public function schedule(){
        
        //Your schedule logic.
        $this->schedule->call(function () {
        
        })->daily();
    }
} 

注册

将以下行添加到你的ServiceProvider注册方法中。

 $this->app->make(iBrand\Scheduling\ScheduleList::class)->add(YourSchedule::class);

果酱云社区

点击跳转

  • 全网真正免费的IT课程平台

  • 专注于综合IT技术的在线课程,致力于打造优质、高效的IT在线教育平台

  • 课程方向包含Python、Java、前端、大数据、数据分析、人工智能等热门IT课程

  • 300+免费课程任你选择

点击跳转