config/app.php

'aliases' => [
// 门面类
// App应用
'App' => Illuminate\Support\Facades\App::class,
// Artisan 命令
'Artisan' => Illuminate\Support\Facades\Artisan::class,
// 权限
'Auth' => Illuminate\Support\Facades\Auth::class,
// Blade模板
'Blade' => Illuminate\Support\Facades\Blade::class,
// 缓存
'Cache' => Illuminate\Support\Facades\Cache::class,
// 配置
'Config' => Illuminate\Support\Facades\Config::class,
// Cookie
'Cookie' => Illuminate\Support\Facades\Cookie::class,
// Crypt加密
'Crypt' => Illuminate\Support\Facades\Crypt::class,
// 数据库
'DB' => Illuminate\Support\Facades\DB::class,
// 事件
'Event' => Illuminate\Support\Facades\Event::class,
// 文件
'File' => Illuminate\Support\Facades\File::class,
// Gate授权
'Gate' => Illuminate\Support\Facades\Gate::class,
// Hash加密
'Hash' => Illuminate\Support\Facades\Hash::class,
// 语言
'Lang' => Illuminate\Support\Facades\Lang::class,
// 日志
'Log' => Illuminate\Support\Facades\Log::class,
// 邮件
'Mail' => Illuminate\Support\Facades\Mail::class,
// 密码
'Password' => Illuminate\Support\Facades\Password::class,
// 队列
'Queue' => Illuminate\Support\Facades\Queue::class,
// 跳转
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// Redis
'Redis' => Illuminate\Support\Facades\Redis::class,
// 请求
'Request' => Illuminate\Support\Facades\Request::class,
// 响应
'Response' => Illuminate\Support\Facades\Response::class,
// 路由
'Route' => Illuminate\Support\Facades\Route::class,
// 数据表Schema
'Schema' => Illuminate\Support\Facades\Schema::class,
// Session
'Session' => Illuminate\Support\Facades\Session::class,
// 存储
'Storage' => Illuminate\Support\Facades\Storage::class,
// URL
'URL' => Illuminate\Support\Facades\URL::class,
// 验证器
'Validator' => Illuminate\Support\Facades\Validator::class,
// 视图
'View' => Illuminate\Support\Facades\View::class,
],

App.php 

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Foundation\Application
*/
class App extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'app';
}
}

Artisan.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Contracts\Console\Kernel
*/
class Artisan extends Facade
{
/**
* Get the registered name of the component.
* 获取组建的注册名称
* @return string
*/
protected static function getFacadeAccessor()
{
return 'Illuminate\Contracts\Console\Kernel';
}
}

Auth.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Auth\AuthManager
* @see \Illuminate\Contracts\Auth\Factory
* @see \Illuminate\Contracts\Auth\Guard
* @see \Illuminate\Contracts\Auth\StatefulGuard
*/
class Auth extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'auth';
}
}

Blade.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\View\Compilers\BladeCompiler
*/
class Blade extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return static::$app['view']->getEngineResolver()->resolve('blade')->getCompiler();
}
}

Cache.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Cache\CacheManager
* @see \Illuminate\Cache\Repository
*/
class Cache extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'cache';
}
}

Config.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Config\Repository
*/
class Config extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'config';
}
}

Cookie.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Cookie\CookieJar
*/
class Cookie extends Facade
{
/**
* Determine if a cookie exists on the request.
* 确定请求中是否存在 cookie。
* @param string $key
* @return bool
*/
public static function has($key)
{
return ! is_null(static::$app['request']->cookie($key, null));
}

/**
* Retrieve a cookie from the request.
* 从请求中获取cookie。
* @param string $key
* @param mixed $default
* @return string
*/
public static function get($key = null, $default = null)
{
return static::$app['request']->cookie($key, $default);
}

/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'cookie';
}
}

Crypt.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Encryption\Encrypter
*/
class Crypt extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'encrypter';
}
}

DB.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Database\DatabaseManager
* @see \Illuminate\Database\Connection
*/
class DB extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'db';
}
}

Event.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Events\Dispatcher
*/
class Event extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'events';
}
}

File.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Filesystem\Filesystem
*/
class File extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'files';
}
}

Gate.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Contracts\Auth\Access\Gate
*/
class Gate extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'Illuminate\Contracts\Auth\Access\Gate';
}
}

Hash.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Hashing\BcryptHasher
*/
class Hash extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'hash';
}
}

Lang.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Translation\Translator
*/
class Lang extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'translator';
}
}

Log.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Log\Writer
*/
class Log extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'log';
}
}

Mail.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Mail\Mailer
*/
class Mail extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'mailer';
}
}

Password.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Auth\Passwords\PasswordBroker
*/
class Password extends Facade
{
/**
* Constant representing a successfully sent reminder.
* 代表成功发送提醒的常量。
* @var string
*/
const RESET_LINK_SENT = 'passwords.sent';

/**
* Constant representing a successfully reset password.
* 代表成功重置密码的常量。
* @var string
*/
const PASSWORD_RESET = 'passwords.reset';

/**
* Constant representing the user not found response.
* 代表用户未找到响应的常量。
* @var string
*/
const INVALID_USER = 'passwords.user';

/**
* Constant representing an invalid password.
* 代表无效密码的常量。
* @var string
*/
const INVALID_PASSWORD = 'passwords.password';

/**
* Constant representing an invalid token.
* 代表无效令牌的常量。
* @var string
*/
const INVALID_TOKEN = 'passwords.token';

/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'auth.password';
}
}

Queue.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Queue\QueueManager
* @see \Illuminate\Queue\Queue
*/
class Queue extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'queue';
}
}

Redirect.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Routing\Redirector
*/
class Redirect extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'redirect';
}
}

Redis.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Redis\Database
*/
class Redis extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'redis';
}
}

Request.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Http\Request
*/
class Request extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'request';
}
}

Response.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Contracts\Routing\ResponseFactory
*/
class Response extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'Illuminate\Contracts\Routing\ResponseFactory';
}
}

Route.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Routing\Router
*/
class Route extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'router';
}
}

Schema.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Database\Schema\Builder
*/
class Schema extends Facade
{
/**
* Get a schema builder instance for a connection.
* 获取连接的架构构建器实例。
* @param string $name
* @return \Illuminate\Database\Schema\Builder
*/
public static function connection($name)
{
return static::$app['db']->connection($name)->getSchemaBuilder();
}

/**
* Get a schema builder instance for the default connection.
* 获取默认连接的架构构建器实例。
* @return \Illuminate\Database\Schema\Builder
*/
protected static function getFacadeAccessor()
{
return static::$app['db']->connection()->getSchemaBuilder();
}
}

Session.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Session\SessionManager
* @see \Illuminate\Session\Store
*/
class Session extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'session';
}
}

Storage.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Filesystem\FilesystemManager
*/
class Storage extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'filesystem';
}
}

Url.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Routing\UrlGenerator
*/
class URL extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'url';
}
}

Validator.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\Validation\Factory
*/
class Validator extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'validator';
}
}

View.php

<?php

namespace Illuminate\Support\Facades;

/**
* @see \Illuminate\View\Factory
*/
class View extends Facade
{
/**
* Get the registered name of the component.
* 获取组件的注册名称。
* @return string
*/
protected static function getFacadeAccessor()
{
return 'view';
}
}