php – Laravel Excel安装
发布时间:2020-05-25 08:48:05 所属栏目:PHP 来源:互联网
导读:我刚刚使用作曲家获得了Maatwebsite Laravel-Excel.我即将使用它,但我是安装/使用包的新手.到目前为止,我只使用了Laravel附带的产品. 我正在阅读 the documentation并且正在遵循这些步骤(我已经完成了前三个步骤),但我对这条线感到困惑; The class is binded
|
我刚刚使用作曲家获得了Maatwebsite Laravel-Excel.我即将使用它,但我是安装/使用包的新手.到目前为止,我只使用了Laravel附带的产品.
The class is binded to the ioC as excel
$excel = App::make('excel');
我真的不知道大多数意思是什么.我已经阅读了一些关于ioC然后依赖注入(对我来说也是新的).但我还是不知道 – 这部分文档是否告诉我要做点什么?我在命令行上运行了php artisan(为了另一个目的),我把它拿回来了; [2015-04-23 13:42:09] local.ERROR: exception 'BadMethodCallException' with message 'Call to undefined method [package]' in /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:226
Stack trace:
#0 /vagrant/source/laravel-excel/vendor/maatwebsite/excel/src/Maatwebsite/Excel/ExcelServiceProvider.php(45): IlluminateSupportServiceProvider->__call('package',Array)
#1 /vagrant/source/laravel-excel/vendor/maatwebsite/excel/src/Maatwebsite/Excel/ExcelServiceProvider.php(45): MaatwebsiteExcelExcelServiceProvider->package('maatwebsite/exc...')
#2 [internal function]: MaatwebsiteExcelExcelServiceProvider->boot()
#3 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Container/Container.php(523): call_user_func_array(Array,Array)
#4 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(703): IlluminateContainerContainer->call(Array)
#5 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(685): IlluminateFoundationApplication->bootProvider(Object(MaatwebsiteExcelExcelServiceProvider))
#6 [internal function]: IlluminateFoundationApplication->IlluminateFoundation{closure}(Object(MaatwebsiteExcelExcelServiceProvider),19)
#7 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(686): array_walk(Array,Object(Closure))
#8 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(15): IlluminateFoundationApplication->boot()
#9 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(181): IlluminateFoundationBootstrapBootProviders->bootstrap(Object(IlluminateFoundationApplication))
#10 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(195): IlluminateFoundationApplication->bootstrapWith(Array)
#11 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(92): IlluminateFoundationConsoleKernel->bootstrap()
#12 /vagrant/source/laravel-excel/artisan(36): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput),Object(SymfonyComponentConsoleOutputConsoleOutput))
#13 {main}
当我在config / app.php中取出maatwebsite引用时,php artisan成功运行 – 所以必须有更多的事情要做,但我不知道是什么. 看起来文档列出了错误的版本. 1.x分支适用于Laravel 4.x. GitHub page 为Laravel 5用户提供了更好的指南.尝试在composer.json中将版本更改为2. *并重新运行composer update.将正确的引用添加回app.php,你应该可以运行php artisan而不会出错.App :: make(‘excel’)命令也应该在那之后工作. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
