I try to run schedule on Laravel 5. Its work fine when I run this:
$schedule->call(function() {
// do something here..
})->everyMinute();
The order is important, but it was never mentioned.
Try this
$schedule->call(function () {
// do something here..
})->name('job_name')->withoutOverlapping()->everyMinute();
This is how it worked for me:
(1) call -> (2) name -> (3) withoutOverlapping -> (4) dailyAt -> (5) onOneServer
when you mess around with the order you can get errors like
A scheduled event name is required to prevent overlapping. Use the
name
method before 'withoutOverlapping'.
or
Call to undefined method Illuminate\Console\Scheduling\Schedule::name()