如何在 Laravel 中设置 PhpSpreadsheet

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51790252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 17:57:43  来源:igfitidea点击:

How to setup PhpSpreadsheet in Laravel

laravelphpspreadsheet

提问by Syed Azeem Haider

I have installed PhpSpreadsheet via composer now need to know the service provider to enter in app.php to use it in my controller.

我已经通过 composer 安装了 PhpSpreadsheet 现在需要知道服务提供者进入 app.php 以在我的控制器中使用它。

回答by Aarón Gutiérrez

I would suggest you use this wrapper around PhpSpreadSheet for Laravel: https://github.com/Maatwebsite/Laravel-Excel

我建议你在 Laravel 的 PhpSpreadSheet 周围使用这个包装器:https: //github.com/Maatwebsite/Laravel-Excel

But you can use PhpSpreadSheet as it is, just as the documentation points out: https://phpspreadsheet.readthedocs.io/en/latest/#welcome-to-phpspreadsheets-documentation

但是您可以按原样使用 PhpSpreadSheet,正如文档指出的那样:https://phpspreadsheet.readthedocs.io/en/latest/#welcome-to-phpspreadsheets-documentation

For using a service provider for this PHP library, you'd need to create it by yourself

要为此 PHP 库使用服务提供者,您需要自己创建它

And of course, try to do first some research by yourself.

当然,先尝试自己做一些研究。