Using the Laravel task scheduler I have created a number of tasks in Kernel.php
e.g:
$schedule->command(\'some:command\')
->daily();
$sche
I was having the task to stop/enable and edit the frequency of the scheduled tasks from the admin dashboard. So I foreach them in Kernel.php and capture the output in function.
$enabled_commands = ConsoleCommand::where('is_enabled', 1)
->get();
foreach ($enabled_commands as $command)
{
$schedule->command($command->command_name)
->{$command->frequency}($command->time)
->after(function () use ($command) {
$this->log($command->command_name);
});
}
Hope this help you.