Ever wonder how some classes do not require a full namespace to be called in a blade view? i.e.
{{ Auth::id() }}
Instead of:
{{ \Illuminate\Support\Facades\Auth::id() }}
Laravel has a configuration file config/app.php
that maps class namespaces to an alias i.e.
// ...
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
// ...
],