HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/api.aianced.com/vendor/laravel/framework/src/Illuminate/Queue/Middleware/Skip.php
<?php

namespace Illuminate\Queue\Middleware;

use Closure;

class Skip
{
    public function __construct(protected bool $skip = false)
    {
    }

    /**
     * Apply the middleware if the given condition is truthy.
     *
     * @param  bool|Closure(): bool  $condition
     */
    public static function when(Closure|bool $condition): self
    {
        return new self(value($condition));
    }

    /**
     * Apply the middleware unless the given condition is truthy.
     *
     * @param  bool|Closure(): bool  $condition
     */
    public static function unless(Closure|bool $condition): self
    {
        return new self(! value($condition));
    }

    /**
     * Handle the job.
     */
    public function handle(mixed $job, callable $next): mixed
    {
        if ($this->skip) {
            return false;
        }

        return $next($job);
    }
}