Larval安装使用Excel步骤

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u013931660/article/details/80733484
Larval 安装调用Excel
composer require maatwebsite/excel ~2.0.0

报错信息:
报错:
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install maatwebsite/excel v2.0.9
    - Conclusion: don't install maatwebsite/excel 2.0.8
    - Conclusion: don't install maatwebsite/excel 2.0.7
    - Conclusion: don't install maatwebsite/excel v2.0.6
    - Conclusion: don't install maatwebsite/excel v2.0.5
    - Conclusion: don't install maatwebsite/excel v2.0.4
    - Conclusion: don't install maatwebsite/excel v2.0.3
    - Conclusion: don't install maatwebsite/excel v2.0.2
    - Conclusion: don't install maatwebsite/excel 2.0.1
    - Conclusion: don't install maatwebsite/excel v2.0.0
    - Conclusion: remove laravel/framework v5.6.23
    - Installation request for symfony/css-selector (locked at v4.1.0) -> satisfiable by symfony/css-selector[v4.1.0].
    - Conclusion: don't install laravel/framework v5.6.23
    - maatwebsite/excel 2.0.11 requires illuminate/config 5.0.*|5.1.*|5.2.* -> satisfiable by illuminate/config[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7].
    - maatwebsite/excel v2.0.10 requires illuminate/config 5.0.*|5.1.* -> satisfiable by illuminate/config[5.0.x-dev, 5.1.x-dev, v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8].
    - don't install illuminate/config 5.0.x-dev|don't install laravel/framework v5.6.23
    - don't install illuminate/config 5.1.x-dev|don't install laravel/framework v5.6.23
    - don't install illuminate/config 5.2.x-dev|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.0|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.22|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.25|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.26|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.28|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.33|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.0.4|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.1|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.13|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.16|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.2|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.20|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.22|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.25|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.28|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.30|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.31|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.41|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.6|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.1.8|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.0|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.19|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.21|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.24|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.25|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.26|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.27|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.28|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.31|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.32|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.37|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.43|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.45|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.6|don't install laravel/framework v5.6.23
    - don't install illuminate/config v5.2.7|don't install laravel/framework v5.6.23
    - Installation request for laravel/framework (locked at v5.6.23, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.23].
    - Installation request for maatwebsite/excel ~2.0.0 -> satisfiable by maatwebsite/excel[2.0.1, 2.0.11, 2.0.7, 2.0.8, v2.0.0, v2.0.10, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.9].

Installation failed, reverting ./composer.json to its original content.

处理步骤:
编辑 composer.json  
require中 将maatwebsite/excel  修改为  "maatwebsite/excel": "2.*",
保存退出

执行:composer update

在config/app.php中注册服务提供者到providers数组:
Maatwebsite\Excel\ExcelServiceProvider::class,

同样在config/app.php中注册门面到aliases数组:
'Excel' => Maatwebsite\Excel\Facades\Excel::class,

php artisan vendor:publish  选择excel对应的数字
展开阅读全文

没有更多推荐了,返回首页