user = $user; $this->message = $message; $this->fail = $fail; } /** * Execute the job. * * @throws Exception */ public function handle(): void { Log::debug('TestJob: '.$this->message, [ 'user' => $this->user->getKey(), ]); if ($this->fail) { throw new Exception('TestJob failed.'); } } }