2017-09-14 22:21:00 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
2019-11-16 10:21:14 +03:00
|
|
|
protected $commands = [];
|
2017-09-14 22:21:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the application's command schedule.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
{
|
|
|
|
// Not installed yet
|
2017-09-23 18:43:09 +03:00
|
|
|
if (!env('APP_INSTALLED')) {
|
2017-09-14 22:21:00 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-03-07 16:41:14 +03:00
|
|
|
$schedule_time = env('APP_SCHEDULE_TIME', '09:00');
|
|
|
|
|
|
|
|
$schedule->command('reminder:invoice')->dailyAt($schedule_time);
|
|
|
|
$schedule->command('reminder:bill')->dailyAt($schedule_time);
|
|
|
|
$schedule->command('recurring:check')->dailyAt($schedule_time);
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the Closure based commands for the application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function commands()
|
|
|
|
{
|
|
|
|
require base_path('routes/console.php');
|
2019-11-16 10:21:14 +03:00
|
|
|
|
|
|
|
$this->load(__DIR__ . '/Commands');
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
}
|