Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 25, 2018 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/f8f06341283a6460b3fb17098d4738f5 to your computer and use it in GitHub Desktop.
Save uno-de-piera/f8f06341283a6460b3fb17098d4738f5 to your computer and use it in GitHub Desktop.
<?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