Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 4 |
Ratio | 30.77 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
32 | public function build() |
||
33 | { |
||
34 | $mailer = $this->view('emails.published_news') |
||
35 | ->subject($this->news->title); |
||
36 | |||
37 | //ATTACH FILES |
||
38 | View Code Duplication | foreach ($this->news->attachments as $file) { |
|
39 | $path = 'app/news_'.$file->imageable_id.'/'.$file->filename; |
||
40 | $mailer->attach(storage_path($path), ['as' => $file->filename, 'mime' => $file->mime]); |
||
41 | } |
||
42 | |||
43 | return $mailer; |
||
44 | } |
||
45 | } |
||
46 |