Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 6 |
| NewsletterJob | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 6 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| handle | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace App\Jobs; | |
| use App\Mail\NewslettersMail; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Illuminate\Foundation\Bus\Dispatchable; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Queue\SerializesModels; | |
| use Illuminate\Support\Facades\Mail; | |
| class NewsletterJob implements ShouldQueue | |
| { | |
| use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | |
| protected $data; | |
| protected $view; | |
| /** | |
| * Create a new job instance. | |
| * @param $data | |
| * @param $view | |
| */ | |
| public function __construct($data, $view) | |
| { | |
| $this->data = $data; | |
| $this->view = $view; | |
| } | |
| /** | |
| * Execute the job. | |
| * | |
| * @return void | |
| */ | |
| public function handle() | |
| { | |
| $newsletterMail = new NewslettersMail($this->data, $this->view); | |
| Mail::to($this->data['email'])->send($newsletterMail); | |
| } | |
| } |