Skip to content

Laravel Run Schedule/Command Every Few Seconds

dhtmldhtml Posts: 27

There are times you need shorter intervals to run your artisan commands.

This package does it for you - https://github.com/spatie/laravel-short-schedule

The great thing about this package is that it works for both laravel and lumen.

Installation:
$ composer require spatie/laravel-short-schedule

Start:
$ php artisan short-schedule:run

Usage:
// in app\Console\Kernel.php
protected function shortSchedule(\Spatie\ShortSchedule\ShortSchedule $shortSchedule) { // this artisan command will run every second $shortSchedule->command('artisan-command')->everySecond(); }

Sign In or Register to comment.