lumen下配置服务容器,门面

注册服务提供者,在bootstrap/app.php文件下加入php

|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/
$app->register(Maatwebsite\Excel\ExcelServiceProvider::class);  //注册Excel服务提供者

添加类别名,在bootstrap/app.php文件下加入web

/*
|--------------------------------------------------------------------------
| 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.
|
*/
class_alias('Maatwebsite\Excel\Facades\Excel', 'Excel');  //添加Excel类别名
相关文章
相关标签/搜索