Job Failed Method

Posted 3 years ago by mhankins

What details can I pass along to the failed method on a job? I want to include some details for the user if possible. Any ideas?

    /**
     * Handle a job failure.
     *
     * @return void
     */
    public function failed()
    {
        $type = 'danger';

        $notification = [
            'type' => $type,
            'title' => 'Something went wrong.',
            'message' => 'Your pulled files for order #'.$this->order->order_num.' did not finish copying',
            'details' => '',
            'user_id' => $this->user_id,
        ];


        event(new OrdersCopied($notification));
    }

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.