What I mean is, how is it you can access the Validator facade without using the FQN in a controller?
Ie, why does validator::make work, not requiring illuminate\blah\facades\validator::make()
How is this accomplished from a PHP standpoint? FYI, I'm not interested in how to alias a class through Laravel's App class, but rather the mechanics of it. Is it done through a custom autoloading function...?
To be precise it's implemented in:
\vendor\laravel\framework\src\Illuminate\Foundation\AliasLoader.php
file, using class_alias() function as @user3158900 mentioned:
public function load($alias)
{
if (isset($this->aliases[$alias]))
{
return class_alias($this->aliases[$alias], $alias);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With