public function failed($exception, $connection, $queue, JobPayload $payload)
    {
        $this->connection()->pipeline(function ($pipe) use ($exception, $connection, $queue, $payload) {
            $this->storeJobReference($pipe, 'failed_jobs', $payload);
            $this->storeJobReference($pipe, 'recent_failed_jobs', $payload);

            $pipe->hmset(
                $payload->id(), [
                    'id' => $payload->id(),
                    'connection' => $connection,
                    'queue' => $queue,
                    'name' => $payload->decoded['displayName'],
                    'status' => 'failed',
                    'payload' => $payload->value,
                    'exception' => (string) $exception,
                    'failed_at' => str_replace(',', '.', microtime(true)),
                ]
            );

            $pipe->expireat(
                $payload->id(), Chronos::now()->addMinutes($this->failedJobExpires)->getTimestamp()
            );
        });
    }
public function failed($exception, $connection, $queue, JobPayload $payload)
    {
        $this->connection()->pipeline(function ($pipe) use ($exception, $connection, $queue, $payload) {
            $this->storeJobReference($pipe, 'failed_jobs', $payload);
            $this->storeJobReference($pipe, 'recent_failed_jobs', $payload);

            $pipe->hmset(
                $payload->id(), [
                    'id' => $payload->id(),
                    'connection' => $connection,
                    'queue' => $queue,
                    'name' => $payload->decoded['displayName'],
                    'status' => 'failed',
                    'payload' => $payload->value,
                    'exception' => (string) $exception,
                    'failed_at' => str_replace(',', '.', microtime(true)),
                ]
            );

            $pipe->expireat(
                $payload->id(), Chronos::now()->addMinutes($this->failedJobExpires)->getTimestamp()
            );
        });
    }
public function failed ( $ exception , $ connection , $ queue , JobPayload $ payload ) { $ this -> connection ( ) -> pipeline ( function ( $ pipe ) use ( $ exception , $ connection , $ queue , $ payload ) { $ this -> storeJobReference ( $ pipe , 'failed_jobs' , $ payload ) ; $ this -> storeJobReference ( $ pipe , 'recent_failed_jobs' , $ payload ) ; $ pipe -> hmset ( $ payload -> id ( ) , [ 'id' => $ payload -> id ( ) , 'connection' => $ connection , 'queue' => $ queue , 'name' => $ payload -> decoded [ 'displayName' ] , 'status' => 'failed' , 'payload' => $ payload -> value , 'exception' => ( string ) $ exception , 'failed_at' => str_replace ( ',' , '.' , microtime ( true ) ) , ] ) ; $ pipe -> expireat ( $ payload -> id ( ) , Chronos :: now ( ) -> addMinutes ( $ this -> failedJobExpires ) -> getTimestamp ( ) ) ; } ) ; }
Mark the job as failed.

@param  string  $exception
@param  string  $connection
@param  string  $queue
@param  \Laravel\Horizon\JobPayload  $payload
@return void
Mark the job as failed .