Closed2
laravel研究
Route::get() の挙動
- Illuminate\Support\Facades\Route extends Facade
- static::getFacadeAccessor() = 'router';
- Illuminate/Support/Facades/Facade::__callStatic($method, $args)
- static::getFacadeRoot();
- return static::resolveFacadeInstance(static::getFacadeAccessor());
- static::resolveFacadeInstance
- return static::
name] = static::resolvedInstance[ name];app[
- return static::
- static::resolveFacadeInstance
- return static::resolveFacadeInstance(static::getFacadeAccessor());
- Facade::$app["router"]->get(...$args)
- Illuminate/Routing/Router.php::get($uri, $action = null)
- self::addRoute(['GET', 'HEAD'], $uri, $action);
- self::addRoute($methods, $uri, $action)
- return $this->routes->add(
methods, $uri, $action));this->createRoute( - Illuminate/Routing/Router::createRoute
- $route = $this->newRoute(
uri), $action );methods, $this->prefix( - self::newRoute($methods, $uri, $action)
- (new Route(
this)->setContainer($this->container);methods, $uri, $action))->setRouter( - Illuminate/Routing/Route.php::setRouter
- $this->router = $router;
- Illuminate/Routing/Route.php::setContainer
- $this->container = $container;
- Illuminate/Routing/Route.php::setRouter
- (new Route(
- self::newRoute($methods, $uri, $action)
- $this->addWhereClausesToRoute($route);
- $route = $this->newRoute(
- Illuminate/Routing/RouteCollectionInterface::add(Route $route);
- Illuminate/Routing/AbstractRouteCollection::get
- Illuminate/Routing/RouteCollection::get($method = null)
- Arr::get($this->routes, $method, []);
- Illuminate/Routing/RouteCollection::get($method = null)
- Illuminate/Routing/AbstractRouteCollection::get
- Illuminate/Routing/Router::createRoute
- return $this->routes->add(
- self::addRoute($methods, $uri, $action)
- self::addRoute(['GET', 'HEAD'], $uri, $action);
- Illuminate/Routing/Router.php::get($uri, $action = null)
- static::getFacadeRoot();
Facede::app["router"]の中身
- bootstrap/app.php
- $app->singleton(Illuminate\Contracts\Console\Kernel::class, ....);
- Illuminate/Foundation/Console/Kernel
- self::$bootstrappers[] = \Illuminate\Foundation\Bootstrap\RegisterFacades::class
- self:bootstrap()
- $this->app->bootstrapWith($this->bootstrappers());
- $this->app->loadDeferredProviders();
- $this->commands();
- Illuminate/Foundation/Bootstrap/RegisterFacades::bootstrap(Application $app)
- Facade::clearResolvedInstances();
- Facade::setFacadeApplication($app);
- Illuminate/Foundation/Bootstrap/RegisterFacades::bootstrap(Application $app)
- Illuminate/Foundation/Application::registerCoreContainerAliases
- $this->alias($key, $alias);
- { 'router' => [\Illuminate\Routing\Router::class, \Illuminate\Contracts\Routing\Registrar::class, }\Illuminate\Contracts\Routing\BindingRegistrar::class],
- self::alias("router", [\Illuminate\Routing\Router::class, \Illuminate\Contracts\Routing\Registrar::class, } \Illuminate\Contracts\Routing\BindingRegistrar::class]);
- Illuminate/Container/Container::alias
- $this->aliases[$alias] = $abstract;
- $this->abstractAliases[$abstract][] = $alias;
- Illuminate/Container/Container::alias
- self::alias("router", [\Illuminate\Routing\Router::class, \Illuminate\Contracts\Routing\Registrar::class, } \Illuminate\Contracts\Routing\BindingRegistrar::class]);
- Illuminate/Foundation/Console/Kernel
- $app->singleton(Illuminate\Contracts\Console\Kernel::class, ....);
このスクラップは6ヶ月前にクローズされました