chiennguyen93/excel
Composer 安装命令:
composer require chiennguyen93/excel
包简介
Supercharged Excel exports and imports in Laravel
README 文档
README
Laravel Excel 3.1
🎉 Celebrating 10 Million Downloads. Read more on our blog! about 5 years of Laravel!
💪 🔥 🚀
Supercharged Excel exports and imports
A simple, but elegant wrapper around PhpSpreadsheet with the goal of simplifying
exports and imports.
Quickstart · Documentation · Nova · Blog · Contributing · Support
-
Easily export collections to Excel. Supercharge your Laravel collections and export them directly to an Excel or CSV document. Exporting has never been so easy.
-
Supercharged exports. Export queries with automatic chunking for better performance. You provide us the query, we handle the performance. Exporting even larger datasets? No worries, Laravel Excel has your back. You can queue your exports so all of this happens in the background.
-
Supercharged imports. Import workbooks and worksheets to Eloquent models with chunk reading and batch inserts! Have large files? You can queue every chunk of a file! Your entire import will happen in the background.
-
Export Blade views. Want to have a custom layout in your spreadsheet? Use a HTML table in a Blade view and export that to Excel.
🚀 5 minutes quick start for exports
💡 Require this package in the composer.json of your Laravel project. This will download the package and PhpSpreadsheet.
composer require maatwebsite/excel
💪 Create an export class in App/Exports
php artisan make:export UsersExport --model=User
This should have created:
<?php namespace App\Exports; use App\User; use Maatwebsite\Excel\Concerns\FromCollection; class UsersExport implements FromCollection { public function collection() { return User::all(); } }
🔥 In your controller you can call this export now:
use App\Exports\UsersExport; use Maatwebsite\Excel\Facades\Excel; use App\Http\Controllers\Controller; class UsersController extends Controller { public function export() { return Excel::download(new UsersExport, 'users.xlsx'); } }
📄 Find your users.xlsx in your downloads folder!
More installation instructions can be found at: https://laravel-excel.maatwebsite.nl/3.1/getting-started/installation.html
🚀 5 minutes quick start for imports
💪 Create an import class in App\Imports
You may do this by using the make:import command.
php artisan make:import UsersImport --model=User
If you prefer to create the import manually, you can create the following in App\Imports:
<?php namespace App\Imports; use App\User; use Illuminate\Support\Facades\Hash; use Maatwebsite\Excel\Concerns\ToModel; class UsersImport implements ToModel { /** * @param array $row * * @return User|null */ public function model(array $row) { return new User([ 'name' => $row[0], 'email' => $row[1], 'password' => Hash::make($row[2]), ]); } }
🔥 In your controller you can call this import now:
use App\Imports\UsersImport; use Maatwebsite\Excel\Facades\Excel; use App\Http\Controllers\Controller; class UsersController extends Controller { public function import() { Excel::import(new UsersImport, 'users.xlsx'); return redirect('/')->with('success', 'All good!'); } }
📄 Find the imported users in your database!
🎓 Learning Laravel Excel
You can find the full documentation of Laravel Excel on the website.
We welcome suggestions for improving our docs. The documentation repository can be found at https://github.com/Maatwebsite/laravel-excel-docs.
Read some articles and tutorials can be found on our blog: https://laravel-excel.maatwebsite.nl/blog/
🔧 Supported Versions
Versions will be supported for a limited amount of time.
| Version | Laravel Version | Php Version | Support |
|---|---|---|---|
| 2.1 | <=5.6 | <=7.0 | Unsupported since 15-5-2018 |
| 3.0 | ^5.5 | ^7.0 | Unsupported since 31-12-2018 |
| 3.1 | ^5.5 | ^7.0 | New features |
📬 License & Postcardware
Our software is open source and licensed under the MIT license.
If you use the software in your production environment we would appreciate to receive a postcard of your hometown. Please send it to:
Maatwebsite
Florijnruwe 111-2
6218 CA Maastricht
The Netherlands
More about the license can be found at: https://laravel-excel.maatwebsite.nl/3.1/getting-started/license.html
chiennguyen93/excel 适用场景与选型建议
chiennguyen93/excel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 02 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「excel」 「csv」 「import」 「export」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chiennguyen93/excel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chiennguyen93/excel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chiennguyen93/excel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
Yii2 export extension
PHP Excel Library
laravel facade to read/write csv file
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-07