extendableConstruct(); } /** * Finds and serves the request using the primary controller. * @param string $url Specifies the requested page URL. * If the parameter is omitted, the current URL used. * @return BaseResponse Returns the response to the provided URL */ public function run($url = '/') { return App::make(Controller::class)->run($url); } public function __call($name, $params) { if ($name === 'extend') { if (empty($params[0]) || !is_callable($params[0])) { throw new \InvalidArgumentException('The extend() method requires a callback parameter or closure.'); } if ($params[0] instanceof \Closure) { return $params[0]->call($this, $params[1] ?? $this); } return \Closure::fromCallable($params[0])->call($this, $params[1] ?? $this); } return $this->extendableCall($name, $params); } public static function __callStatic($name, $params) { if ($name === 'extend') { if (empty($params[0])) { throw new \InvalidArgumentException('The extend() method requires a callback parameter or closure.'); } self::extendableExtendCallback($params[0], $params[1] ?? false, $params[2] ?? null); return; } return self::extendableCallStatic($name, $params); } }