invoice = $invoice; $this->userId = $userId; $this->reminder = $reminder; $this->template = $template; $this->proposal = $proposal; $this->server = config('database.default'); } /** * Execute the job. * * @param ContactMailer $mailer */ public function handle(ContactMailer $mailer) { // send email as user if (App::runningInConsole() && $this->userId) { Auth::onceUsingId($this->userId); } $mailer->sendInvoice($this->invoice, $this->reminder, $this->template, $this->proposal); if (App::runningInConsole() && $this->userId) { Auth::logout(); } } /* * Handle a job failure. * * @param ContactMailer $mailer * @param Logger $logger */ /* public function failed(ContactMailer $mailer, Logger $logger) { $this->jobName = $this->job->getName(); parent::failed($mailer, $logger); } */ }