Store your schedules in database (cache friendly)
-
Run
composer require therezor/laravel-database-schedule
in your laravel project root folder -
Run
php artisan vendor:publish --provider="TheRezor\DatabaseSchedule\ServiceProvider"
-
Apply migration
php artisan migrate
-
Use
TheRezor\DatabaseSchedule\Models\Schedule
to manage your database schedule
<?php
$schedule = new Schedule();
$schedule->dailyAt('18:00');
$schedule->command = MyComand::class;
$schedule->params = ['id' => 1];
$schedule->save();
}
?>