class Illuminate / Foundation / Http / Kernel
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Kernel

Implements

Uses

Properties

protected

$app Application

The application implementation.

Default: null
protected

$router Router

The router instance.

Default: null
protected

$bootstrappers string[]

The bootstrap classes for the application.

Default: array
protected

$middleware array|string>

The application's middleware stack.

Default: []
protected

$middlewareGroups array|string>>

The application's route middleware groups.

Default: []
deprecated protected

$routeMiddleware array|string>

The application's route middleware.

Default: []
protected

$middlewareAliases array|string>

The application's middleware aliases.

Default: []
protected

$requestLifecycleDurationHandlers array

All of the registered request duration handlers.

Default: []
protected

$requestStartedAt Carbon |null

When the kernel starting handling the current request.

Default: null
protected

$middlewarePriority string[]

The priority-sorted list of middleware.

Forces non-global middleware to always be in the given order.

Default: array

Methods

public

__construct ( Application $app , Router $router ) : void

Create a new HTTP kernel instance.

Parameters

public

handle ( $request ) : Response

Handle an incoming HTTP request.

Parameters

protected

sendRequestThroughRouter ( $request ) : Response

Send the given request through the middleware / router.

Parameters

public

bootstrap ( ) : void

Bootstrap the application for HTTP requests.

protected

dispatchToRouter ( ) : Closure

Get the route dispatcher callback.

public

terminate ( $request , $response ) : void

Call the terminate method on any terminable middleware.

Parameters

protected

terminateMiddleware ( $request , $response ) : void

Call the terminate method on any terminable middleware.

Parameters

public

whenRequestLifecycleIsLongerThan ( $threshold , $handler ) : void

Register a callback to be invoked when the requests lifecycle duration exceeds a given amount of time.

Parameters

public

requestStartedAt ( ) : Carbon |null

When the request being handled started.

protected

gatherRouteMiddleware ( $request ) : array

Gather the route middleware for the given request.

Parameters

protected

parseMiddleware ( $middleware ) : array

Parse a middleware string to get the name and parameters.

Parameters

  • $middleware string
public

hasMiddleware ( $middleware ) : bool

Determine if the kernel has a given middleware.

Parameters

  • $middleware string
public

prependMiddleware ( $middleware ) : $this

Add a new middleware to the beginning of the stack if it does not already exist.

Parameters

  • $middleware string
public

pushMiddleware ( $middleware ) : $this

Add a new middleware to end of the stack if it does not already exist.

Parameters

  • $middleware string
public

prependMiddlewareToGroup ( $group , $middleware ) : $this

Prepend the given middleware to the given middleware group.

Parameters

  • $group string
  • $middleware string
public

appendMiddlewareToGroup ( $group , $middleware ) : $this

Append the given middleware to the given middleware group.

Parameters

  • $group string
  • $middleware string
public

prependToMiddlewarePriority ( $middleware ) : $this

Prepend the given middleware to the middleware priority list.

Parameters

  • $middleware string
public

appendToMiddlewarePriority ( $middleware ) : $this

Append the given middleware to the middleware priority list.

Parameters

  • $middleware string
protected

syncMiddlewareToRouter ( ) : void

Sync the current state of the middleware to the router.

public

getMiddlewarePriority ( ) : array

Get the priority-sorted list of middleware.

protected

bootstrappers ( ) : array

Get the bootstrap classes for the application.

protected

reportException ( Throwable $e ) : void

Report the exception to the exception handler.

Parameters

protected

renderException ( $request , Throwable $e ) : Symfony\...\Response

Render the exception to a response.

Parameters

public

getMiddlewareGroups ( ) : array

Get the application's route middleware groups.

deprecated public

getRouteMiddleware ( ) : array

Get the application's route middleware aliases.

public

getMiddlewareAliases ( ) : array

Get the application's route middleware aliases.

public

getApplication ( ) : Application

Get the Laravel application instance.

public

setApplication ( Application $app ) : $this

Set the Laravel application instance.

Parameters