Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 25, 2018
Embed
What would you like to do?
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use File;
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)
{
$cronLog = storage_path('logs/cron.log');
if (!File::exists($cronLog)) {
File::put($cronLog, '');
}
$schedule->command('generator:random_user')->everyMinute()->withoutOverlapping()->appendOutputTo($cronLog);
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment