next = $nextMiddleware; } public function handle(IRequest $request, callable $next) { if ($this->next !== null) { return $this->next->handle($request, $next); } return $next($request); } }