src/Http/Kernel.php
/**
	 * Executes the middleware and controller for the current matched route. The callback, which is optional, will be
	 * called once the route has been matched. The route is passed as the first and only argument.
	 *
	 * @param callable $callback
	 * @throws HorizonException
	 */
Executes the middleware and controller for the current matched route. The callback, which is optional, will be
called once the route has been matched. The route is passed as the first and only argument.

@param callable $callback
@throws HorizonException
Executes the middleware and controller for the current matched route . The callback which is optional will be called once the route has been matched . The route is passed as the first and only argument . @param callable $callback @throws HorizonException
public function execute($callback = null) {
		Profiler::start('kernel:http');
		$this->executePipes('before');
		$route = $this->route = $this->match();
		$this->executePipes('after');
		if ($route) {
			if (is_callable($callback)) {
				call_user_func($callback, $route);
			}
			try {
				Profiler::start('http:middleware');
				$this->executeMiddleware($route, 'before');
				Profiler::stop('http:middleware');
				Profiler::start('http:controller');
				$this->executeController($route);
				Profiler::stop('http:controller');
				Profiler::start('http:middleware');
				$this->executeMiddleware($route, 'after');
				Profiler::stop('http:middleware');
			}
			catch (Exception $e) {
				$this->handleException($e, $route);
			}
		}
		Profiler::stop('kernel:http');
		$this->close();
	}
public function execute ( $ callback = null ) { Profiler :: start ( 'kernel:http' ) ; $ this -> executePipes ( 'before' ) ; $ route = $ this -> route = $ this -> match ( ) ; $ this -> executePipes ( 'after' ) ; if ( $ route ) { if ( is_callable ( $ callback ) ) { call_user_func ( $ callback , $ route ) ; } try { Profiler :: start ( 'http:middleware' ) ; $ this -> executeMiddleware ( $ route , 'before' ) ; Profiler :: stop ( 'http:middleware' ) ; Profiler :: start ( 'http:controller' ) ; $ this -> executeController ( $ route ) ; Profiler :: stop ( 'http:controller' ) ; Profiler :: start ( 'http:middleware' ) ; $ this -> executeMiddleware ( $ route , 'after' ) ; Profiler :: stop ( 'http:middleware' ) ; } catch ( Exception $ e ) { $ this -> handleException ( $ e , $ route ) ; } } Profiler :: stop ( 'kernel:http' ) ; $ this -> close ( ) ; }
Executes the middleware and controller for the current matched route.
Executes the middleware and controller for the current matched route .
// Find a matching route // If the route was found, execute it // Run callback // Run middleware (beforeExecute) // Run the controller // Run middleware (afterExecute) // Close