Kernel::commands()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Console;
4
5
use App\Console\Commands\SendEmailsExpiringRepetitiveEvents;
6
use Illuminate\Console\Scheduling\Schedule;
7
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
8
9
class Kernel extends ConsoleKernel
10
{
11
    /**
12
     * The Artisan commands provided by your application.
13
     *
14
     * @var array
15
     */
16
    protected $commands = [
17
        //
18
    ];
19
20
    /**
21
     * Define the application's command schedule.
22
     *
23
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
24
     * @return void
25
     */
26
    protected function schedule(Schedule $schedule)
27
    {
28
        $logPath = storage_path('logs/schedule.log');
29
30
        $schedule->command(SendEmailsExpiringRepetitiveEvents::class)
31
            ->daily()
32
            ->appendOutputTo($logPath)
33
            ->emailOutputTo(env('WEBMASTER_MAIL'));
34
35 118
        $schedule->command('sitemap:generate')->daily();
36
37 118
        // Backup
38
//        $schedule->command('backup:clean')->weekly()->sundays()->at('00:00');
39 118
        $schedule->command('backup:run')->weekly()->sundays()->at('00:30');
40 118
    }
41
42
    /**
43
     * Register the commands for the application.
44
     *
45
     * @return void
46
     */
47
    protected function commands()
48
    {
49
        $this->load(__DIR__.'/Commands');
50
51
        require base_path('routes/console.php');
52
    }
53
}
54