我正在阅读 the documentation并且正在遵循这些步骤(我已经完成了前三个步骤),但我对这条线感到困惑;
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:226Stack trace:#0 /vagrant/source/laravel-excel/vendor/maatwebsite/excel/src/Maatwebsite/Excel/ExcelServiceProvIDer.PHP(45): Illuminate\Support\ServiceProvIDer->__call('package',Array)#1 /vagrant/source/laravel-excel/vendor/maatwebsite/excel/src/Maatwebsite/Excel/ExcelServiceProvIDer.PHP(45): Maatwebsite\Excel\ExcelServiceProvIDer->package('maatwebsite/exc...')#2 [internal function]: Maatwebsite\Excel\ExcelServiceProvIDer->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): Illuminate\Container\Container->call(Array)#5 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.PHP(685): Illuminate\Foundation\Application->bootProvIDer(Object(Maatwebsite\Excel\ExcelServiceProvIDer))#6 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Maatwebsite\Excel\ExcelServiceProvIDer),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): Illuminate\Foundation\Application->boot()#9 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Application.PHP(181): Illuminate\Foundation\bootstrap\BootProvIDers->bootstrap(Object(Illuminate\Foundation\Application))#10 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.PHP(195): Illuminate\Foundation\Application->bootstrapWith(Array)#11 /vagrant/source/laravel-excel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.PHP(92): Illuminate\Foundation\Console\Kernel->bootstrap()#12 /vagrant/source/laravel-excel/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\input\Argvinput),Object(Symfony\Component\Console\Output\ConsoleOutput))#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’)命令也应该在那之后工作.
总结以上是内存溢出为你收集整理的php – Laravel Excel安装全部内容,希望文章能够帮你解决php – Laravel Excel安装所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)