2017 © Pedro Peláez
 

library scheduling

An independent scheduling for other Laravel's package.

image

dmpty/scheduling

An independent scheduling for other Laravel's package.

  • Monday, February 20, 2017
  • by dmPty
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Scheduling 简介

在 Laravel 中,开发者要使用任务调度必须要将任务写进app/Console/Kernel.php文件,而无法包含在 package 中。, (*1)

Scheduling 允许你在你的 package 中添加 Laravel 任务调度。, (*2)

安装与使用

在项目根目录下运行如下composer命令:, (*3)

composer require dmpty/scheduling:dev-master

注册服务提供者:, (*4)

config/app.php文件中 providers 数组里加入:, (*5)

dmpty\Scheduling\Providers\SchedulingProvider::class,

注意:请将SchedulingProvider在所有使用此包提供的方法定义任务调度的服务提供者之前注册!, (*6)

定义任务调度:, (*7)

在你的项目中建立任务调度文件并继承src\Schedule\Scheduling.php文件,并重写schedule()方法,具体使用方法请参考Laravel任务调度。, (*8)

class YourClassName extends Scheduling
{

    public function schedule()
    {
        $this->schedule->call(function () {
            // Job
        })->daily();
    }

}

在你项目的ServiceProvider中注册这个类:, (*9)

public function register()
{
    $this->app->make('dmpty\ScheduleList')->add(YourClassName::class);
}

大功告成!, (*10)

The Versions

20/02 2017

dev-master

9999999-dev

An independent scheduling for other Laravel's package.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar dmPty

laravel schedule scheduling

20/02 2017

1.0.1

1.0.1.0

An independent scheduling for other Laravel's package.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar dmPty

laravel schedule scheduling

20/02 2017

1.0.0

1.0.0.0

An independent scheduling for other Laravel's package.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar dmPty

laravel schedule scheduling