File: /var/www/vhost/disk-apps/demo-sigedo.teky.com.co/app/Console/Kernel.php
<?php
namespace App\Console;
use App\Programming;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$programmings = Programming::where('active', true)->with('automaticprocess')->get();
foreach ($programmings as $key => $value) {
switch ($value->automaticprocess->typeprocess_id) {
case '1': // envio de notificación
$schedule->command('huv:sendNotification', [$value->id])->cron($value->cron);
break;
case '2': // envio de reportes
$schedule->command('huv:sendReport', [$value->id])->cron($value->cron);
break;
case '3': // envio de procesos
$schedule->command('huv:sendProcess', [$value->id])->cron($value->cron);
break;
default:
break;
}
}
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}