blessing-skin-server/app/Http/Middleware/AfterSessionBooted.php

34 lines
586 B
PHP
Raw Normal View History

2017-01-18 22:31:35 +08:00
<?php
namespace App\Http\Middleware;
use Closure;
class AfterSessionBooted
{
/**
* Jobs should be done after session booted.
*
* @var array
*/
static $jobs;
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
foreach (static::$jobs as $job) {
if (is_callable($job)) {
app()->call($job);
}
}
return $next($request);
}
}