mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-30 13:12:56 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace app\Console;
 | |
| 
 | |
| use Utils;
 | |
| 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 = [
 | |
|         'App\Console\Commands\SendRecurringInvoices',
 | |
|         'App\Console\Commands\ResetData',
 | |
|         'App\Console\Commands\CheckData',
 | |
|         'App\Console\Commands\SendRenewalInvoices',
 | |
|         'App\Console\Commands\SendReminders',
 | |
|         'App\Console\Commands\TestOFX',
 | |
|     ];
 | |
| 
 | |
|     /**
 | |
|      * Define the application's command schedule.
 | |
|      *
 | |
|      * @param  \Illuminate\Console\Scheduling\Schedule $schedule
 | |
|      * @return void
 | |
|      */
 | |
|     protected function schedule(Schedule $schedule)
 | |
|     {
 | |
|         $logFile = storage_path() . '/logs/cron.log';
 | |
| 
 | |
|         $schedule
 | |
|             ->command('ninja:send-invoices --force')
 | |
|             ->sendOutputTo($logFile)
 | |
|             ->withoutOverlapping()
 | |
|             ->hourly();
 | |
| 
 | |
|         $schedule
 | |
|             ->command('ninja:send-reminders --force')
 | |
|             ->sendOutputTo($logFile)
 | |
|             ->daily();
 | |
| 
 | |
|         if (Utils::isNinja()) {
 | |
|             $schedule
 | |
|                 ->command('ninja:send-renewals --force')
 | |
|                 ->sendOutputTo($logFile)
 | |
|                 ->daily();
 | |
|         }
 | |
|     }
 | |
| }
 |