laravel 导出Excel

版权声明:转载请注明博主地址 https://blog.csdn.net/weixin_43885417/article/details/85028311

我们在项目时,经常需要去查数据库中的信息,导出excel。laravel提供了一个插件。
它有个github地址:https://github.com/Maatwebsite/Laravel-Excel

  1. 首先,我们先用composer下载:
composer require "maatwebsite/excel:~2.1.0"
  1. 然后,需要注册 一个服务提供者,在config/app.phpproviders数组中
    在这里插入图片描述
    在这里插入图片描述
  2. 然后,还是这个文件,在aliases数组中注册门面。
    在这里插入图片描述
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43885417/article/details/85028311