Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

6. Middleware

SimplyUnnamed edited this page Aug 13, 2021 · 1 revision

There are two middlewares that can currently be extended which are called before the ESI jobs take place.

CheckEsiStatus and CheckServerStatus.

The base implementation currently just goes to the next middleware, but they can be extended to suite your way of keeping track of Server and Esi Status.

first, you need to create your middleware which implement \LaravelEveTools\EveApi\Contract\CheckEsiStatusInterface and \LaravelEveTools\EveApi\Contract\CheckServerStatusInterface respectively.

ie.

Namespace App\Jobs\Middleware;
class CheckEsiStatus implements \LaravelEveTools\EveApi\Contract\CheckEsiStatusInterface {
    
    public function handle($job, $next)
    {
        if(!cache()->get('esi_status', false))
            return

        $next($job);
    }
}

Now, in register function in your service provider, you can extend the interface with your own implementation.

public function register()
{
    $this->app->extend(\LaravelEveTools\EveApi\Jobs\Middleware\CheckEsiStatusInterface::class, \App\Jobs\Middleware\CheckEsiStatus);
}

Clone this wiki locally