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
![]() |
|||
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 |