class Kernel implements Kernel (View source)

Properties

protected Application $app The application implementation.
protected Router $router The router instance.
protected array $bootstrappers The bootstrap classes for the application.
protected array $middleware The application's middleware stack.
protected array $middlewareGroups The application's route middleware groups.
protected array $routeMiddleware The application's route middleware.
protected array $middlewarePriority The priority-sorted list of middleware.

Methods

void
__construct(Application $app, Router $router)

Create a new HTTP kernel instance.

Response
handle(Request $request)

Handle an incoming HTTP request.

sendRequestThroughRouter(Request $request)

Send the given request through the middleware / router.

void
bootstrap()

Bootstrap the application for HTTP requests.

dispatchToRouter()

Get the route dispatcher callback.

void
terminate(Request $request, Response $response)

Call the terminate method on any terminable middleware.

void
terminateMiddleware(Request $request, Response $response)

Call the terminate method on any terminable middleware.

array
gatherRouteMiddleware(Request $request)

Gather the route middleware for the given request.

array
parseMiddleware(string $middleware)

Parse a middleware string to get the name and parameters.

bool
hasMiddleware(string $middleware)

Determine if the kernel has a given middleware.

$this
prependMiddleware(string $middleware)

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

$this
pushMiddleware(string $middleware)

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

array
bootstrappers()

Get the bootstrap classes for the application.

void
reportException(Exception $e)

Report the exception to the exception handler.

Response
renderException(Request $request, Exception $e)

Render the exception to a response.

getApplication()

Get the Laravel application instance.

Details

void __construct(Application $app, Router $router)

Create a new HTTP kernel instance.

Parameters

Application $app
Router $router

Return Value

void

Response handle(Request $request)

Handle an incoming HTTP request.

Parameters

Request $request

Return Value

Response

protected Response sendRequestThroughRouter(Request $request)

Send the given request through the middleware / router.

Parameters

Request $request

Return Value

Response

void bootstrap()

Bootstrap the application for HTTP requests.

Return Value

void

protected Closure dispatchToRouter()

Get the route dispatcher callback.

Return Value

Closure

void terminate(Request $request, Response $response)

Call the terminate method on any terminable middleware.

Parameters

Request $request
Response $response

Return Value

void

protected void terminateMiddleware(Request $request, Response $response)

Call the terminate method on any terminable middleware.

Parameters

Request $request
Response $response

Return Value

void

protected array gatherRouteMiddleware(Request $request)

Gather the route middleware for the given request.

Parameters

Request $request

Return Value

array

protected array parseMiddleware(string $middleware)

Parse a middleware string to get the name and parameters.

Parameters

string $middleware

Return Value

array

bool hasMiddleware(string $middleware)

Determine if the kernel has a given middleware.

Parameters

string $middleware

Return Value

bool

$this prependMiddleware(string $middleware)

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

Parameters

string $middleware

Return Value

$this

$this pushMiddleware(string $middleware)

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

Parameters

string $middleware

Return Value

$this

protected array bootstrappers()

Get the bootstrap classes for the application.

Return Value

array

protected void reportException(Exception $e)

Report the exception to the exception handler.

Parameters

Exception $e

Return Value

void

protected Response renderException(Request $request, Exception $e)

Render the exception to a response.

Parameters

Request $request
Exception $e

Return Value

Response

Application getApplication()

Get the Laravel application instance.

Return Value

Application