2017 © Pedro Peláez
 

library laravel-task-scheduler

An Lightweight Laravel Task Scheduling Package

image

cyub/laravel-task-scheduler

An Lightweight Laravel Task Scheduling Package

  • Friday, June 30, 2017
  • by cyub
  • Repository
  • 0 Watchers
  • 4 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 18 % Grown

The README.md

Laravel 5 Lightweight Task Scheduler

An Lightweight Task Scheduler Package for Laravel 5. This package allows you to dispatch all scheduled jobs and run at the time., (*1)

Installation

Require the package, (*2)

composer require "cyub/laravel-task-scheduler"

After adding the package, add the ServiceProvider to the providers array in config/app.php, (*3)

'providers' => [
    ...
    Tink\Scheduler\SchedulerServiceProvider::class,
    ...
];

Then, publish the scheduler config and migration the database of scheduler, (*4)

php artisan scheduler:install

Configuration

After Install the package, You will find the Configuration in config\scheduler.php, (*5)

return [
    'enable' => true,
    'schedule_table_name' => 'cron_schedule',
    'schedule_generate_every' => 1,
    'schedule_ahead_for' => 50,
    'schedule_lifetime' => 15,
    'history_cleanup_every' => 10,
    'history_success_lifetime' => 600,
    'history_failure_lifetime' => 600,

    'schedules' => [
        'RegisterRedpacket.activate' => [
            'schedule'  => [
                'cron_expr'   => '*/1 * * * *',
            ],
            'run'   => [
                'class' => App\Cron\RegisterRedpacket::class,
                'function'  => 'activate',
                'params'    => ['isSendSmsNotice' => true]
            ],
            'description' => 'activate register redpacket'
        ]
    ]
];

Usage

Dispatch job and run

php artisan scheduler:dispatch

You can use in Cron, (*6)

* * * * * php /your-application-path/artisan scheduler:dispatch >> /dev/null 2>&1

View the scheduler config

php artisan scheduler:info config

scheduler config, (*7)

View the scheduler run result stats

php artisan scheduler:info stats

scheduler config, (*8)

Clean the scheduler cache

php artisan scheduler:clean

The Versions

30/06 2017

dev-master

9999999-dev

An Lightweight Laravel Task Scheduling Package

  Sources   Download

MIT

The Requires

 

by Avatar cyub

laravel task scheduling

30/06 2017

0.1.0

0.1.0.0

An Lightweight Laravel Task Scheduling Package

  Sources   Download

MIT

The Requires

 

by Avatar cyub

laravel task scheduling