MonthlyReport   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A build() 0 3 1
1
<?php
2
3
namespace App\Mail;
4
5
use App\Models\Teacher;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Mail\Mailable;
9
use Illuminate\Queue\SerializesModels;
10
use Illuminate\Support\Carbon;
11
12
class MonthlyReport extends Mailable implements ShouldQueue
13
{
14
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\MonthlyReport: $id, $relations, $class, $keyBy
Loading history...
15
16
    public string $monthName;
17
18
    public int $year;
19
20
    public Carbon $start;
21
22
    public Carbon $end;
23
24
    public $teachers;
25
26
    public function __construct()
27
    {
28
        Carbon::setLocale('fr');
29
        $this->monthName = Carbon::now()->monthName;
30
        $this->year = Carbon::now()->year;
31
32
        $this->start = Carbon::parse('First day of this month');
33
        $this->end = Carbon::parse('Last day of this month');
34
35
        $this->teachers = Teacher::with('remote_events')->with('events')->with('courses')->get();
36
    }
37
38
    public function build()
39
    {
40
        return $this->view('emails.monthly-report');
41
    }
42
}
43