CanvasServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
namespace App\Providers;
4
5
use Canvas\Canvas;
6
use Illuminate\Support\ServiceProvider;
7
use Illuminate\Console\Scheduling\Schedule;
8
9
class CanvasServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any application services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        // Canvas::night();
19
    }
20
21
    /**
22
     * Bootstrap any application services.
23
     *
24
     * @return void
25
     */
26
    public function boot()
27
    {
28
        $this->app->booted(function () {
29
            $schedule = resolve(Schedule::class);
30
            $schedule->command('canvas:digest')
31
                ->weekly()
32
                ->sundays()
33
                ->at('13:00')
34
                ->when(function () {
35
                    return config('canvas.mail.enabled');
36
                });
37
        });
38
    }
39
}
40