1.在 app/Http/Tools 创建一个类 Player

2. 在 app目录下创建Facade 文件夹,此文件夹是用来专门存放自定义门面,在 app/Facade目录下创建一个PL类继承于Facade

3. 在App/Providers 创建 PlayerServiceProvider 类

4. 在config/app.php 中
providers 数组中添加 AppProvidersPlayerServiceProvider::class,
aliases 中 添加 'PL' => AppHttpToolsPlayer::class,
5. 在其他类中的使用

from:https://www.jianshu.com/p/ccbafab75f61