Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 489 Bytes

queue-named-closure.md

File metadata and controls

26 lines (20 loc) · 489 Bytes

Call Named Queued Closure

Allow Naming Queued Closures.

<?php

namespace App\Utilities;
use Illuminate\Queue\CallQueuedClosure;

class CallNamedQueuedClosure extends CallQueuedClosure
{
    protected $displayName = null;

    public function setDisplayName(string $value)
    {
        return $this->displayName = $value;
    }

    public function displayName()
    {
        $name = $this->displayName ?? parent::displayName();
        return "(Closure) {$name}";
    }
}