Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
33.33% covered (danger)
33.33%
2 / 6
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Kernel
33.33% covered (danger)
33.33%
2 / 6
50.00% covered (danger)
50.00%
1 / 2
3.19
0.00% covered (danger)
0.00%
0 / 1
 schedule
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 commands
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Console;
4
5use App\Console\Commands\Messages\MessagesFromRabbit;
6use Illuminate\Console\Scheduling\Schedule;
7use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
8
9class Kernel extends ConsoleKernel
10{
11    protected $commands = [
12        MessagesFromRabbit::class,
13    ];
14
15    /**
16     * Define the application's command schedule.
17     *
18     * @param Schedule $schedule
19     * @return void
20     */
21    protected function schedule(Schedule $schedule): void
22    {
23        // Run command to parse the messages
24        $schedule->command('queue:messages', ['--is-scheduled' => true])
25            ->everyMinute();
26
27        // Run command to do the messages backups to cloud
28        $schedule->command('db:messages-backup-to-cloud')
29            ->everyTwoHours();
30    }
31
32    /**
33     * Register the commands for the application.
34     *
35     * @return void
36     */
37    protected function commands(): void
38    {
39        $this->load(__DIR__.'/Commands');
40        require base_path('routes/console.php');
41    }
42}