日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Laravel Scheduling Package

發(fā)布時(shí)間:2025/6/16 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Laravel Scheduling Package 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Laravel 是在 App\Console\Kernel 類(lèi)中的 schedule 方法去定義所有的調(diào)度任務(wù)。

iBrand 產(chǎn)品作為一個(gè)電商類(lèi)產(chǎn)品,本身業(yè)務(wù)需求非常龐大和復(fù)雜,全部定義在 schedule 方法中會(huì)非常臃腫。而且 iBrand 產(chǎn)品的每個(gè)模塊都是一個(gè) Package,具有高度的復(fù)用性。

所以我們開(kāi)發(fā)了此包,用來(lái)把各個(gè)模塊的調(diào)度任務(wù)放在自己的包里,而不是全部放在 App\Console\Kernel 類(lèi)的 schedule 方法中。

github: ibrandcc/laravel-scheduling

Installation

$ composer require ibrand/laravel-scheduling -vvv
If your Laravel version below 5.5, you need add the follow line to the section providers of config/app.php:

iBrand\Scheduling\ServiceProvider::class,

Usage

extend Scheduling abstract class

use iBrand\Scheduling\Scheduling;

class YourSchedule extends Scheduling {

public function schedule(){//Your schedule logic.$this->schedule->call(function () {})->daily(); } 復(fù)制代碼

}

register

Add follow line to you ServiceProvider register method.

$this->app->make(iBrand\Scheduling\ScheduleList::class)->add(YourSchedule::class); 歡迎大家 star 和提交 issue :) Laravel & VUE & 小程序 & 電商產(chǎn)品 交流群:674454674 暗號(hào):segmentfault

總結(jié)

以上是生活随笔為你收集整理的Laravel Scheduling Package的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。