1
votes

How Laravel is aware of where the Router class path is? I'm aware of the concept of Facade. Now for instance Route alias point to the Route facade that return the name of the class "router"... how Laravel knows that Router is in the vendor\laravel\framework\src\Illuminate\Routing path?

/**
 * Get the registered name of the component.
 *
 * @return string
 */
protected static function getFacadeAccessor()
{
    return 'router';
}
1

1 Answers

0
votes

The facade is used to resolve whatever is bound to the IoC container using that name, in this case the router.

So if you go to Illuminate\Foundation\Application.php there is a method called registerCoreContainerAliases, this is where the binding is set.