updated-packages
This commit is contained in:
20
vendor/maatwebsite/excel/.styleci.yml
vendored
Normal file
20
vendor/maatwebsite/excel/.styleci.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
preset: laravel
|
||||
|
||||
risky: false
|
||||
|
||||
enabled:
|
||||
- align_double_arrow
|
||||
- align_equals
|
||||
- concat_with_spaces
|
||||
- ordered_class_elements
|
||||
|
||||
disabled:
|
||||
- concat_without_spaces
|
||||
- not_operator_with_successor_space
|
||||
- unalign_equals
|
||||
|
||||
finder:
|
||||
not-name:
|
||||
- "*.md"
|
||||
not-path:
|
||||
- ".github"
|
148
vendor/maatwebsite/excel/CHANGELOG.md
vendored
Normal file
148
vendor/maatwebsite/excel/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Custom heading row formatter can use column index (#3166)
|
||||
- Added WithFormatData concern (#3154)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Create failures of rows than didn't exists but where requested in row validation
|
||||
|
||||
## [3.1.30] - 2021-04-06
|
||||
|
||||
### Added
|
||||
|
||||
- Octane compatibility
|
||||
|
||||
## [3.1.29] - 2021-03-16
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix AfterImport Event not being called (#3085)
|
||||
|
||||
## [3.1.28] - 2021-03-10
|
||||
|
||||
### Added
|
||||
|
||||
- Added WithUpsertColumns concern (#3046)
|
||||
- Added ShouldQueueWithoutChain concern (#3072)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Limit Phpspreadsheet version to 1.16 until bugfix release
|
||||
- Fixed issue with not autosizing columns (#3055)
|
||||
- Fix selecting worksheets by name with chunk reading (#3052)
|
||||
|
||||
## [3.1.27] - 2021-02-22
|
||||
|
||||
### Added
|
||||
|
||||
- Added SkipsEmptyRows concern
|
||||
- Added HasReferencesToOtherSheets concern to allow import of calculated
|
||||
|
||||
### Changed
|
||||
|
||||
- Bump minimum PhpSpreadsheet version
|
||||
- Progressbar NullOutput as fallback
|
||||
|
||||
## [3.1.26] - 2020-11-13
|
||||
|
||||
### Added
|
||||
|
||||
- PHP 8 support
|
||||
|
||||
## [3.1.25] - 2020-11-13
|
||||
|
||||
### Added
|
||||
|
||||
- Added an ability to prepare rows before appending rows to sheet. Just add `prepareRows` method for your export class if needed.
|
||||
- Added an ability to catch exceptions from `QueueExport` job. Just add `failed` method for your export class if needed.
|
||||
- Added an ability to set locale for queued export. Just implement `Illuminate\Contracts\Translation\HasLocalePreference` for your export.
|
||||
- Added `JsonSerializable` support in `Maatwebsite\Excel\Validators\Failure`.
|
||||
- Added `$maxExceptions` support in `Maatwebsite\Excel\Jobs\ReadChunk.php`.
|
||||
- Added support to upsert models by implementing the `WithUpserts` concern.
|
||||
|
||||
## [3.1.24] - 2020-10-28
|
||||
|
||||
### Added
|
||||
|
||||
- Added support for `prepareForValidation` on `WithValidation` concern
|
||||
- Added support for `withValidator` on `WithValidation` concern
|
||||
- Added `ArrayAccess` to `Row`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Corrected SkipsErrors doc block
|
||||
|
||||
## [3.1.23] - 2020-09-29
|
||||
|
||||
### Added
|
||||
- Added `ignore_empty` setting to `config/excel.php`
|
||||
- Added `strict_null_comparison` setting to `config/excel.php`
|
||||
|
||||
## [3.1.22] - 2020-09-08
|
||||
|
||||
- Laravel 8 support
|
||||
- Lumen improvements
|
||||
|
||||
## [3.1.21] - 2020-08-06
|
||||
|
||||
### Added
|
||||
- Added WithProperties concern
|
||||
- Added default spreadsheet properties config
|
||||
- Added WithColumnWidths concern
|
||||
- Added WithStyles concern.
|
||||
- Config setting to configure cell caching
|
||||
|
||||
### Changed
|
||||
- Sheet titles longer than 31 chars get trimmed.
|
||||
- Sheet titles with unsupported chars get cleaned.
|
||||
|
||||
### Fixed
|
||||
- Fixed issue with using ShouldAutosize in combination with FromView column widths.
|
||||
|
||||
## [3.1.20] - 2020-07-22
|
||||
|
||||
### Added
|
||||
- Re-sycing remote temporary file
|
||||
- Remember row number
|
||||
- Remember chunk offset
|
||||
- WithColumnLimit concern
|
||||
- WithReadFilter concern
|
||||
- Publishing the stubs
|
||||
|
||||
### Changed
|
||||
- Interacting with queued jobs
|
||||
- Retry until and middleware on queued imports
|
||||
- Using WithValidation with FromCollection & FromArray
|
||||
- Read filters for WithLimit and HeadingRowImport
|
||||
- Bump of minimum version PhpSpreadsheet
|
||||
|
||||
### Fixed
|
||||
- Fixed test helper docblocks on the Excel facade.
|
||||
- Fix for importing with a start row beyond the highest row.
|
||||
- Fixed `BeforeSheet` and `AfterSheet` events receiving exportable instance instead of importable when calling on an Import.
|
||||
- Fix for value binders not working in queued exports.
|
||||
- Fix when using WithLimit concern when having less rows than the limit.
|
||||
- Fix AfterImport job being fired twice if not using queueing.
|
||||
- Raw() method now also available on Exportable.
|
||||
- Fix for breaking changes in PhpSpreadsheet with empty enclosures.
|
||||
|
||||
[Unreleased]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.30...HEAD
|
||||
[3.1.30]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.29...3.1.30
|
||||
[3.1.29]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.28...3.1.29
|
||||
[3.1.28]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.27...3.1.28
|
||||
[3.1.27]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.26...3.1.27
|
||||
[3.1.26]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.25...3.1.26
|
||||
[3.1.25]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.24...3.1.25
|
||||
[3.1.24]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.23...3.1.24
|
||||
[3.1.23]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.22...3.1.23
|
||||
[3.1.22]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.21...3.1.22
|
||||
[3.1.21]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.20...3.1.21
|
||||
[3.1.20]: https://github.com/Maatwebsite/Laravel-Excel/compare/3.1.19...3.1.20
|
||||
|
||||
_Older release notes can be found in Github releases._
|
2
vendor/maatwebsite/excel/CODE_OF_CONDUCT.md
vendored
2
vendor/maatwebsite/excel/CODE_OF_CONDUCT.md
vendored
@@ -43,4 +43,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
3
vendor/maatwebsite/excel/CONTRIBUTING.md
vendored
Normal file
3
vendor/maatwebsite/excel/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Contributing
|
||||
|
||||
Find the contributing guide at: https://docs.laravel-excel.com/3.1/getting-started/contributing.html
|
2
vendor/maatwebsite/excel/LICENSE
vendored
2
vendor/maatwebsite/excel/LICENSE
vendored
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
139
vendor/maatwebsite/excel/README.md
vendored
139
vendor/maatwebsite/excel/README.md
vendored
@@ -1,100 +1,101 @@
|
||||
## Laravel Excel v2.1.* for Laravel 5
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/7728097/67977317-26178100-fc18-11e9-943e-c5302ca32622.png" width="400" height="82" alt="Laravel Excel logo">
|
||||
</p>
|
||||
|
||||
Looking for Laravel Excel for Laravel 4? Visit the [`1.3` branch](https://github.com/Maatwebsite/Laravel-Excel/tree/1.3)
|
||||
<h3 align="center">Supercharged Excel exports and imports</h3>
|
||||
|
||||
[<img src="http://www.maatwebsite.nl/img/excel_banner.jpg"/>](https://laravel-excel.maatwebsite.nl/)
|
||||
[<img src="https://cloud.githubusercontent.com/assets/7728097/6332170/1b495af2-bb84-11e4-9a93-34a9abc01840.jpg"/>](http://www.maatwebsite.nl/vacature-php-programmeur-maastricht)
|
||||
<p align="center">
|
||||
A simple, but elegant <a href="https://laravel.com" target="_blank">Laravel<a/> wrapper around <a href="https://phpspreadsheet.readthedocs.io/" target="_blank">PhpSpreadsheet</a>
|
||||
exports and imports.
|
||||
</p>
|
||||
|
||||
Laravel Excel brings the power of PHPOffice's PHPExcel to Laravel 5 with a touch of the Laravel Magic. It includes features like: importing Excel and CSV to collections, exporting models, array's and views to Excel, importing batches of files and importing a file by a config file.
|
||||
<h4 align="center">
|
||||
<a href="https://docs.laravel-excel.com/3.1/exports/">Quickstart</a>
|
||||
<span> · </span>
|
||||
<a href="https://docs.laravel-excel.com/3.1/getting-started/">Documentation</a>
|
||||
<span> · </span>
|
||||
<a href="https://course.laravel-excel.com">Video Course</a>
|
||||
<span> · </span>
|
||||
<a href="https://github.com/Maatwebsite/Laravel-Nova-Excel">Nova</a>
|
||||
<span> · </span>
|
||||
<a href="https://medium.com/maatwebsite/laravel-excel/home">Blog</a>
|
||||
<span> · </span>
|
||||
<a href="https://docs.laravel-excel.com/3.1/getting-started/contributing.html">Contributing</a>
|
||||
<span> · </span>
|
||||
<a href="https://docs.laravel-excel.com/3.1/getting-started/support.html">Support</a>
|
||||
</h4>
|
||||
|
||||
- Import into Laravel **Collections**
|
||||
- Export **Blade views** to Excel and CSV with optional CSS styling
|
||||
- **Batch** imports
|
||||
- A lot of optional **config settings**
|
||||
- Easy **cell caching**
|
||||
- Chunked and queued importer
|
||||
- ExcelFile method injections
|
||||
- Editing existing Excel files
|
||||
- **Advanced import** by config files
|
||||
- and many more...
|
||||
<p align="center">
|
||||
<a href="https://github.com/Maatwebsite/Laravel-Excel/actions">
|
||||
<img src="https://github.com/Maatwebsite/Laravel-Excel/workflows/Run%20tests/badge.svg?branch=3.1" alt="Github Actions">
|
||||
</a>
|
||||
|
||||
---
|
||||
<a href="https://styleci.io/repos/14259390">
|
||||
<img src="https://styleci.io/repos/14259390/shield?branch=3.1" alt="StyleCI">
|
||||
</a>
|
||||
|
||||
```php
|
||||
Excel::create('Laravel Excel', function($excel) {
|
||||
<a href="https://packagist.org/packages/maatwebsite/excel">
|
||||
<img src="https://poser.pugx.org/maatwebsite/excel/v/stable.png" alt="Latest Stable Version">
|
||||
</a>
|
||||
|
||||
$excel->sheet('Excel sheet', function($sheet) {
|
||||
<a href="https://packagist.org/packages/maatwebsite/excel">
|
||||
<img src="https://poser.pugx.org/maatwebsite/excel/downloads.png" alt="Total Downloads">
|
||||
</a>
|
||||
|
||||
$sheet->setOrientation('landscape');
|
||||
<a href="https://packagist.org/packages/maatwebsite/excel">
|
||||
<img src="https://poser.pugx.org/maatwebsite/excel/license.png" alt="License">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
});
|
||||
## ✨ Features
|
||||
|
||||
})->export('xls');
|
||||
```
|
||||
- **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.
|
||||
|
||||
[](https://travis-ci.org/Maatwebsite/Laravel-Excel)
|
||||
[](https://packagist.org/packages/maatwebsite/excel) [](https://packagist.org/packages/maatwebsite/excel) [](https://packagist.org/packages/maatwebsite/excel)
|
||||
[](https://packagist.org/packages/maatwebsite/excel)
|
||||
[](https://packagist.org/packages/maatwebsite/excel)
|
||||
- **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.
|
||||
|
||||
# Installation
|
||||
- **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.
|
||||
|
||||
Require this package in your `composer.json` and update composer. This will download the package and PHPExcel of PHPOffice.
|
||||

|
||||
<br>
|
||||
|
||||
```php
|
||||
composer require "maatwebsite/excel:~2.1.0"
|
||||
```
|
||||
## 🎓 Learning Laravel Excel
|
||||
|
||||
In Laravel 5.5 or higher, this package will be automatically discovered and you can safely skip the following two steps.
|
||||
You can find the full documentation of Laravel Excel [on the website](https://docs.laravel-excel.com).
|
||||
|
||||
If using Laravel 5.4 or lower, after updating composer, add the ServiceProvider to the providers array in `config/app.php`
|
||||
We welcome suggestions for improving our docs. The documentation repository can be found at [https://github.com/Maatwebsite/laravel-excel-docs](https://github.com/Maatwebsite/laravel-excel-docs).
|
||||
|
||||
```php
|
||||
Maatwebsite\Excel\ExcelServiceProvider::class,
|
||||
```
|
||||
Some articles and tutorials can be found on our blog: https://medium.com/maatwebsite/laravel-excel/home
|
||||
|
||||
You can use the facade for shorter code; if using Laravel 5.4 or lower, add this to your aliases:
|
||||
## 🎥 Video Course
|
||||
|
||||
```php
|
||||
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
|
||||
```
|
||||
We are currently building a video course called "Advanced Laravel Excel". In this video course we’ll build a small application with real-life, complex imports and exports that go beyond simple user imports and exports. We’ll go step-by-step and tackle implementing Laravel Excel in a performant way.
|
||||
|
||||
The class is bound to the ioC as `excel`
|
||||
If you sign up now, you’ll get notified when the course launches and get it for the early bird price of $69 instead of ~~$99~~.
|
||||
|
||||
```php
|
||||
$excel = App::make('excel');
|
||||
```
|
||||
https://course.laravel-excel.com
|
||||
|
||||
To publish the config settings in Laravel 5 use:
|
||||
## :mailbox_with_mail: License & Postcardware
|
||||
|
||||
```php
|
||||
php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"
|
||||
```
|
||||

|
||||
|
||||
This will add an `excel.php` config file to your config folder.
|
||||
Laravel Excel is completely free (MIT license) to use, however the package is licensed as Postcardware. This means that if it makes it to your production environment, we would very much appreciate receiving a postcard from your hometown.
|
||||
|
||||
# Documentation
|
||||
**Maatwebsite**
|
||||
Markt 2
|
||||
6231 LS Meerssen
|
||||
The Netherlands
|
||||
|
||||
The complete documentation can be found at: [https://laravel-excel.maatwebsite.nl/docs](https://laravel-excel.maatwebsite.nl/docs)
|
||||
More about the license can be found at: [https://docs.laravel-excel.com/3.1/getting-started/license.html](https://docs.laravel-excel.com/3.1/getting-started/license.html)
|
||||
|
||||
# Support
|
||||
|
||||
Support only through Github. Please don't mail us about issues, make a Github issue instead.
|
||||
## :wrench: Supported Versions
|
||||
|
||||
# Contributing
|
||||
Versions will be supported for a limited amount of time.
|
||||
|
||||
**ALL** bug fixes should be made to appropriate branch (e.g. `2.0` for 2.0.* bug fixes). Bug fixes should never be sent to the `master` branch.
|
||||
|
||||
More about contributing can be found at: [https://laravel-excel.maatwebsite.nl/docs/2.1/getting-started/contributing](https://laravel-excel.maatwebsite.nl/docs/2.1/getting-started/contributing)
|
||||
|
||||
# License
|
||||
|
||||
This package is licensed under MIT. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!
|
||||
|
||||
# FAQ
|
||||
|
||||
1) Chunk importer only imports the first row
|
||||
|
||||
Check that auto_detect_line_endings in your php.ini is set to true.
|
||||
| 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.8\|^6.0\|^7.0\|^8.0 | ^7.2\|^8.0 | New features |
|
||||
|
15
vendor/maatwebsite/excel/SECURITY.md
vendored
Normal file
15
vendor/maatwebsite/excel/SECURITY.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Security Policy
|
||||
|
||||
**PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, [SEE BELOW](#reporting-a-vulnerability).**
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Version | Security Fixes Until
|
||||
--- | ---
|
||||
3.1 | -
|
||||
3.0 | 31-12-2018
|
||||
2.1 | 15-5-2018
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a security vulnerability within Laravel Excel, please send an email to Patrick Brouwers at patrick@maatwebsite.nl. All security vulnerabilities will be promptly addressed.
|
60
vendor/maatwebsite/excel/composer.json
vendored
60
vendor/maatwebsite/excel/composer.json
vendored
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"name": "maatwebsite/excel",
|
||||
"description": "Supercharged Excel exports in Laravel",
|
||||
"description": "Supercharged Excel exports and imports in Laravel",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"php",
|
||||
"phpspreadsheet",
|
||||
"phpexcel",
|
||||
"excel",
|
||||
"csv",
|
||||
@@ -13,54 +15,40 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maatwebsite.nl",
|
||||
"name": "Patrick Brouwers",
|
||||
"email": "patrick@maatwebsite.nl"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5",
|
||||
"phpoffice/phpexcel": "^1.8.1",
|
||||
"illuminate/cache": "^5.0",
|
||||
"illuminate/config": "^5.0",
|
||||
"illuminate/filesystem": "^5.0",
|
||||
"illuminate/support": "^5.0",
|
||||
"jeremeamia/superclosure": "^2.3",
|
||||
"nesbot/carbon": "~1.0",
|
||||
"tijsverkoyen/css-to-inline-styles": "~2.0"
|
||||
"ext-json": "*",
|
||||
"php": "^7.0|^8.0",
|
||||
"phpoffice/phpspreadsheet": "1.16.*",
|
||||
"illuminate/support": "5.8.*|^6.0|^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpseclib/phpseclib": "~1.0",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"mockery/mockery": "~1.0",
|
||||
"orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*"
|
||||
},
|
||||
"suggest": {
|
||||
"illuminate/http": "^5.0",
|
||||
"illuminate/routing": "^5.0",
|
||||
"illuminate/view": "^5.0",
|
||||
"illuminate/queue": "^5.0"
|
||||
"orchestra/testbench": "^6.0",
|
||||
"predis/predis": "^1.1"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/Maatwebsite/Excel"
|
||||
],
|
||||
"psr-0": {
|
||||
"psr-4": {
|
||||
"Maatwebsite\\Excel\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [
|
||||
"tests/TestCase.php"
|
||||
]
|
||||
"psr-4": {
|
||||
"Maatwebsite\\Excel\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Maatwebsite\\Excel\\ExcelServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
|
||||
}
|
||||
}
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Maatwebsite\\Excel\\ExcelServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
|
||||
}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
|
328
vendor/maatwebsite/excel/config/excel.php
vendored
Normal file
328
vendor/maatwebsite/excel/config/excel.php
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
return [
|
||||
'exports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Chunk size
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using FromQuery, the query is automatically chunked.
|
||||
| Here you can specify how big the chunk should be.
|
||||
|
|
||||
*/
|
||||
'chunk_size' => 1000,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pre-calculate formulas during export
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pre_calculate_formulas' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable strict null comparison
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When enabling strict null comparison empty cells ('') will
|
||||
| be added to the sheet.
|
||||
*/
|
||||
'strict_null_comparison' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'line_ending' => PHP_EOL,
|
||||
'use_bom' => false,
|
||||
'include_separator_line' => false,
|
||||
'excel_compatibility' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
],
|
||||
|
||||
'imports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Read Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might only be interested in the
|
||||
| data that the sheet exists. By default we ignore all styles,
|
||||
| however if you want to do some logic based on style data
|
||||
| you can enable it by setting read_only to false.
|
||||
|
|
||||
*/
|
||||
'read_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignore Empty
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might be interested in ignoring
|
||||
| rows that have null values or empty strings. By default rows
|
||||
| containing empty strings or empty values are not ignored but can be
|
||||
| ignored by enabling the setting ignore_empty to true.
|
||||
|
|
||||
*/
|
||||
'ignore_empty' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading Row Formatter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure the heading row formatter.
|
||||
| Available options: none|slug|custom
|
||||
|
|
||||
*/
|
||||
'heading_row' => [
|
||||
'formatter' => 'slug',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'escape_character' => '\\',
|
||||
'contiguous' => false,
|
||||
'input_encoding' => 'UTF-8',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension detector
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which writer/reader type should be used when the package
|
||||
| needs to guess the correct type based on the extension alone.
|
||||
|
|
||||
*/
|
||||
'extension_detector' => [
|
||||
'xlsx' => Excel::XLSX,
|
||||
'xlsm' => Excel::XLSX,
|
||||
'xltx' => Excel::XLSX,
|
||||
'xltm' => Excel::XLSX,
|
||||
'xls' => Excel::XLS,
|
||||
'xlt' => Excel::XLS,
|
||||
'ods' => Excel::ODS,
|
||||
'ots' => Excel::ODS,
|
||||
'slk' => Excel::SLK,
|
||||
'xml' => Excel::XML,
|
||||
'gnumeric' => Excel::GNUMERIC,
|
||||
'htm' => Excel::HTML,
|
||||
'html' => Excel::HTML,
|
||||
'csv' => Excel::CSV,
|
||||
'tsv' => Excel::TSV,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDF Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which Pdf driver should be used by default.
|
||||
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
||||
|
|
||||
*/
|
||||
'pdf' => Excel::DOMPDF,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Value Binder
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| PhpSpreadsheet offers a way to hook into the process of a value being
|
||||
| written to a cell. In there some assumptions are made on how the
|
||||
| value should be formatted. If you want to change those defaults,
|
||||
| you can implement your own default value binder.
|
||||
|
|
||||
| Possible value binders:
|
||||
|
|
||||
| [x] Maatwebsite\Excel\DefaultValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
||||
|
|
||||
*/
|
||||
'value_binder' => [
|
||||
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default cell caching driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default PhpSpreadsheet keeps all cell values in memory, however when
|
||||
| dealing with large files, this might result into memory issues. If you
|
||||
| want to mitigate that, you can configure a cell caching driver here.
|
||||
| When using the illuminate driver, it will store each value in a the
|
||||
| cache store. This can slow down the process, because it needs to
|
||||
| store each value. You can use the "batch" store if you want to
|
||||
| only persist to the store when the memory limit is reached.
|
||||
|
|
||||
| Drivers: memory|illuminate|batch
|
||||
|
|
||||
*/
|
||||
'driver' => 'memory',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Batch memory caching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with the "batch" caching driver, it will only
|
||||
| persist to the store when the memory limit is reached.
|
||||
| Here you can tweak the memory limit to your liking.
|
||||
|
|
||||
*/
|
||||
'batch' => [
|
||||
'memory_limit' => 60000,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Illuminate cache
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "illuminate" caching driver, it will automatically use
|
||||
| your default cache store. However if you prefer to have the cell
|
||||
| cache on a separate store, you can configure the store name here.
|
||||
| You can use any store defined in your cache config. When leaving
|
||||
| at "null" it will use the default store.
|
||||
|
|
||||
*/
|
||||
'illuminate' => [
|
||||
'store' => null,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Transaction Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default the import is wrapped in a transaction. This is useful
|
||||
| for when an import may fail and you want to retry it. With the
|
||||
| transactions, the previous import gets rolled-back.
|
||||
|
|
||||
| You can disable the transaction handler by setting this to null.
|
||||
| Or you can choose a custom made transaction handler here.
|
||||
|
|
||||
| Supported handlers: null|db
|
||||
|
|
||||
*/
|
||||
'transactions' => [
|
||||
'handler' => 'db',
|
||||
],
|
||||
|
||||
'temporary_files' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Local Temporary Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When exporting and importing files, we use a temporary file, before
|
||||
| storing reading or downloading. Here you can customize that path.
|
||||
|
|
||||
*/
|
||||
'local_path' => storage_path('framework/laravel-excel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Temporary Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup with queues in which you
|
||||
| cannot rely on having a shared local temporary path, you might
|
||||
| want to store the temporary file on a shared disk. During the
|
||||
| queue executing, we'll retrieve the temporary file from that
|
||||
| location instead. When left to null, it will always use
|
||||
| the local path. This setting only has effect when using
|
||||
| in conjunction with queued imports and exports.
|
||||
|
|
||||
*/
|
||||
'remote_disk' => null,
|
||||
'remote_prefix' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Force Resync
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup as above, it's possible
|
||||
| for the clean up that occurs after entire queue has been run to only
|
||||
| cleanup the server that the last AfterImportJob runs on. The rest of the server
|
||||
| would still have the local temporary file stored on it. In this case your
|
||||
| local storage limits can be exceeded and future imports won't be processed.
|
||||
| To mitigate this you can set this config value to be true, so that after every
|
||||
| queued chunk is processed the local temporary file is deleted on the server that
|
||||
| processed it.
|
||||
|
|
||||
*/
|
||||
'force_resync_remote' => null,
|
||||
],
|
||||
];
|
1
vendor/maatwebsite/excel/dump.rdb
vendored
1
vendor/maatwebsite/excel/dump.rdb
vendored
@@ -1 +0,0 @@
|
||||
REDIS0006<EFBFBD>ܳC<EFBFBD>Z<EFBFBD><EFBFBD>V
|
11
vendor/maatwebsite/excel/provides.json
vendored
11
vendor/maatwebsite/excel/provides.json
vendored
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"providers": [
|
||||
"Maatwebsite\\Excel\\ExcelServiceProvider"
|
||||
],
|
||||
"aliases": [
|
||||
{
|
||||
"alias": "Excel",
|
||||
"facade": "Maatwebsite\\Excel\\Facades\\Excel"
|
||||
}
|
||||
]
|
||||
}
|
142
vendor/maatwebsite/excel/src/Cache/BatchCache.php
vendored
Normal file
142
vendor/maatwebsite/excel/src/Cache/BatchCache.php
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Cache;
|
||||
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
|
||||
class BatchCache implements CacheInterface
|
||||
{
|
||||
/**
|
||||
* @var CacheInterface
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* @var MemoryCache
|
||||
*/
|
||||
protected $memory;
|
||||
|
||||
/**
|
||||
* @param CacheInterface $cache
|
||||
* @param MemoryCache $memory
|
||||
*/
|
||||
public function __construct(CacheInterface $cache, MemoryCache $memory)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->memory = $memory;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if ($this->memory->has($key)) {
|
||||
return $this->memory->get($key);
|
||||
}
|
||||
|
||||
return $this->cache->get($key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
$this->memory->set($key, $value, $ttl);
|
||||
|
||||
if ($this->memory->reachedMemoryLimit()) {
|
||||
return $this->cache->setMultiple($this->memory->flush(), $ttl);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
if ($this->memory->has($key)) {
|
||||
return $this->memory->delete($key);
|
||||
}
|
||||
|
||||
return $this->cache->delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->memory->clear();
|
||||
|
||||
return $this->cache->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
// Check if all keys are still in memory
|
||||
$memory = $this->memory->getMultiple($keys, $default);
|
||||
$actualItemsInMemory = count(array_filter($memory));
|
||||
|
||||
if ($actualItemsInMemory === count($keys)) {
|
||||
return $memory;
|
||||
}
|
||||
|
||||
// Get all rows from cache if none is hold in memory.
|
||||
if ($actualItemsInMemory === 0) {
|
||||
return $this->cache->getMultiple($keys, $default);
|
||||
}
|
||||
|
||||
// Add missing values from cache.
|
||||
foreach ($this->cache->getMultiple($keys, $default) as $key => $value) {
|
||||
if (null !== $value) {
|
||||
$memory[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $memory;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
$this->memory->setMultiple($values, $ttl);
|
||||
|
||||
if ($this->memory->reachedMemoryLimit()) {
|
||||
return $this->cache->setMultiple($this->memory->flush(), $ttl);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
$keys = is_array($keys) ? $keys : iterator_to_array($keys);
|
||||
|
||||
$this->memory->deleteMultiple($keys);
|
||||
|
||||
return $this->cache->deleteMultiple($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
if ($this->memory->has($key)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->cache->has($key);
|
||||
}
|
||||
}
|
76
vendor/maatwebsite/excel/src/Cache/CacheManager.php
vendored
Normal file
76
vendor/maatwebsite/excel/src/Cache/CacheManager.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Cache;
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Manager;
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
|
||||
class CacheManager extends Manager
|
||||
{
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const DRIVER_BATCH = 'batch';
|
||||
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const DRIVER_MEMORY = 'memory';
|
||||
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const DRIVER_ILLUMINATE = 'illuminate';
|
||||
|
||||
/**
|
||||
* Get the default driver name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultDriver(): string
|
||||
{
|
||||
return config('excel.cache.driver', 'memory');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MemoryCache
|
||||
*/
|
||||
public function createMemoryDriver(): CacheInterface
|
||||
{
|
||||
return new MemoryCache(
|
||||
config('excel.cache.batch.memory_limit', 60000)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BatchCache
|
||||
*/
|
||||
public function createBatchDriver(): CacheInterface
|
||||
{
|
||||
return new BatchCache(
|
||||
$this->createIlluminateDriver(),
|
||||
$this->createMemoryDriver()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CacheInterface
|
||||
*/
|
||||
public function createIlluminateDriver(): CacheInterface
|
||||
{
|
||||
return Cache::driver(
|
||||
config('excel.cache.illuminate.store')
|
||||
);
|
||||
}
|
||||
|
||||
public function flush()
|
||||
{
|
||||
$this->driver()->clear();
|
||||
}
|
||||
|
||||
public function isInMemory(): bool
|
||||
{
|
||||
return $this->getDefaultDriver() === self::DRIVER_MEMORY;
|
||||
}
|
||||
}
|
138
vendor/maatwebsite/excel/src/Cache/MemoryCache.php
vendored
Normal file
138
vendor/maatwebsite/excel/src/Cache/MemoryCache.php
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Cache;
|
||||
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
|
||||
class MemoryCache implements CacheInterface
|
||||
{
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
protected $memoryLimit;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $cache = [];
|
||||
|
||||
/**
|
||||
* @param int|null $memoryLimit
|
||||
*/
|
||||
public function __construct(int $memoryLimit = null)
|
||||
{
|
||||
$this->memoryLimit = $memoryLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->cache = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
unset($this->cache[$key]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
$this->delete($key);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if ($this->has($key)) {
|
||||
return $this->cache[$key];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
$results = [];
|
||||
foreach ($keys as $key) {
|
||||
$results[$key] = $this->get($key, $default);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
return isset($this->cache[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
$this->cache[$key] = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
foreach ($values as $key => $value) {
|
||||
$this->set($key, $value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function reachedMemoryLimit(): bool
|
||||
{
|
||||
// When no limit is given, we'll never reach any limit.
|
||||
if (null === $this->memoryLimit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return count($this->cache) >= $this->memoryLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function flush(): array
|
||||
{
|
||||
$memory = $this->cache;
|
||||
|
||||
$this->clear();
|
||||
|
||||
return $memory;
|
||||
}
|
||||
}
|
82
vendor/maatwebsite/excel/src/Cell.php
vendored
Normal file
82
vendor/maatwebsite/excel/src/Cell.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Exception;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell as SpreadsheetCell;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class Cell
|
||||
{
|
||||
use DelegatedMacroable;
|
||||
|
||||
/**
|
||||
* @var SpreadsheetCell
|
||||
*/
|
||||
private $cell;
|
||||
|
||||
/**
|
||||
* @param SpreadsheetCell $cell
|
||||
*/
|
||||
public function __construct(SpreadsheetCell $cell)
|
||||
{
|
||||
$this->cell = $cell;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Worksheet $worksheet
|
||||
* @param string $coordinate
|
||||
*
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||
* @return Cell
|
||||
*/
|
||||
public static function make(Worksheet $worksheet, string $coordinate)
|
||||
{
|
||||
return new static($worksheet->getCell($coordinate));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SpreadsheetCell
|
||||
*/
|
||||
public function getDelegate(): SpreadsheetCell
|
||||
{
|
||||
return $this->cell;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $nullValue
|
||||
* @param bool $calculateFormulas
|
||||
* @param bool $formatData
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue($nullValue = null, $calculateFormulas = false, $formatData = true)
|
||||
{
|
||||
$value = $nullValue;
|
||||
if ($this->cell->getValue() !== null) {
|
||||
if ($this->cell->getValue() instanceof RichText) {
|
||||
$value = $this->cell->getValue()->getPlainText();
|
||||
} elseif ($calculateFormulas) {
|
||||
try {
|
||||
$value = $this->cell->getCalculatedValue();
|
||||
} catch (Exception $e) {
|
||||
$value = $this->cell->getOldCalculatedValue();
|
||||
}
|
||||
} else {
|
||||
$value = $this->cell->getValue();
|
||||
}
|
||||
|
||||
if ($formatData) {
|
||||
$style = $this->cell->getWorksheet()->getParent()->getCellXfByIndex($this->cell->getXfIndex());
|
||||
$value = NumberFormat::toFormattedString(
|
||||
$value,
|
||||
($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : NumberFormat::FORMAT_GENERAL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
108
vendor/maatwebsite/excel/src/ChunkReader.php
vendored
Normal file
108
vendor/maatwebsite/excel/src/ChunkReader.php
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\PendingDispatch;
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Concerns\ShouldQueueWithoutChain;
|
||||
use Maatwebsite\Excel\Concerns\WithChunkReading;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Concerns\WithLimit;
|
||||
use Maatwebsite\Excel\Concerns\WithProgressBar;
|
||||
use Maatwebsite\Excel\Events\BeforeImport;
|
||||
use Maatwebsite\Excel\Files\TemporaryFile;
|
||||
use Maatwebsite\Excel\Imports\HeadingRowExtractor;
|
||||
use Maatwebsite\Excel\Jobs\AfterImportJob;
|
||||
use Maatwebsite\Excel\Jobs\QueueImport;
|
||||
use Maatwebsite\Excel\Jobs\ReadChunk;
|
||||
use Throwable;
|
||||
|
||||
class ChunkReader
|
||||
{
|
||||
/**
|
||||
* @param WithChunkReading $import
|
||||
* @param Reader $reader
|
||||
* @param TemporaryFile $temporaryFile
|
||||
*
|
||||
* @return \Illuminate\Foundation\Bus\PendingDispatch|null
|
||||
*/
|
||||
public function read(WithChunkReading $import, Reader $reader, TemporaryFile $temporaryFile)
|
||||
{
|
||||
if ($import instanceof WithEvents && isset($import->registerEvents()[BeforeImport::class])) {
|
||||
$reader->beforeImport($import);
|
||||
}
|
||||
|
||||
$chunkSize = $import->chunkSize();
|
||||
$totalRows = $reader->getTotalRows();
|
||||
$worksheets = $reader->getWorksheets($import);
|
||||
$queue = property_exists($import, 'queue') ? $import->queue : null;
|
||||
$delayCleanup = property_exists($import, 'delayCleanup') ? $import->delayCleanup : 600;
|
||||
|
||||
if ($import instanceof WithProgressBar) {
|
||||
$import->getConsoleOutput()->progressStart(array_sum($totalRows));
|
||||
}
|
||||
|
||||
$jobs = new Collection();
|
||||
foreach ($worksheets as $name => $sheetImport) {
|
||||
$startRow = HeadingRowExtractor::determineStartRow($sheetImport);
|
||||
|
||||
if ($sheetImport instanceof WithLimit) {
|
||||
$limit = $sheetImport->limit();
|
||||
|
||||
if ($limit <= $totalRows[$name]) {
|
||||
$totalRows[$name] = $sheetImport->limit();
|
||||
}
|
||||
}
|
||||
|
||||
for ($currentRow = $startRow; $currentRow <= $totalRows[$name]; $currentRow += $chunkSize) {
|
||||
$jobs->push(new ReadChunk(
|
||||
$import,
|
||||
$reader->getPhpSpreadsheetReader(),
|
||||
$temporaryFile,
|
||||
$name,
|
||||
$sheetImport,
|
||||
$currentRow,
|
||||
$chunkSize
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$afterImportJob = new AfterImportJob($import, $reader);
|
||||
|
||||
if ($import instanceof ShouldQueueWithoutChain) {
|
||||
$jobs->push($afterImportJob->delay($delayCleanup));
|
||||
|
||||
return $jobs->each(function ($job) use ($queue) {
|
||||
dispatch($job->onQueue($queue));
|
||||
});
|
||||
}
|
||||
|
||||
$jobs->push($afterImportJob);
|
||||
|
||||
if ($import instanceof ShouldQueue) {
|
||||
return new PendingDispatch(
|
||||
(new QueueImport($import))->chain($jobs->toArray())
|
||||
);
|
||||
}
|
||||
|
||||
$jobs->each(function ($job) {
|
||||
try {
|
||||
dispatch_now($job);
|
||||
} catch (Throwable $e) {
|
||||
if (method_exists($job, 'failed')) {
|
||||
$job->failed($e);
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
});
|
||||
|
||||
if ($import instanceof WithProgressBar) {
|
||||
$import->getConsoleOutput()->progressFinish();
|
||||
}
|
||||
|
||||
unset($jobs);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
117
vendor/maatwebsite/excel/src/Concerns/Exportable.php
vendored
Normal file
117
vendor/maatwebsite/excel/src/Concerns/Exportable.php
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Foundation\Bus\PendingDispatch;
|
||||
use Maatwebsite\Excel\Exceptions\NoFilenameGivenException;
|
||||
use Maatwebsite\Excel\Exceptions\NoFilePathGivenException;
|
||||
use Maatwebsite\Excel\Exporter;
|
||||
|
||||
trait Exportable
|
||||
{
|
||||
/**
|
||||
* @param string $fileName
|
||||
* @param string|null $writerType
|
||||
* @param array $headers
|
||||
*
|
||||
* @throws NoFilenameGivenException
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
*/
|
||||
public function download(string $fileName = null, string $writerType = null, array $headers = null)
|
||||
{
|
||||
$headers = $headers ?? $this->headers ?? [];
|
||||
$fileName = $fileName ?? $this->fileName ?? null;
|
||||
$writerType = $writerType ?? $this->writerType ?? null;
|
||||
|
||||
if (null === $fileName) {
|
||||
throw new NoFilenameGivenException();
|
||||
}
|
||||
|
||||
return $this->getExporter()->download($this, $fileName, $writerType, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $writerType
|
||||
* @param mixed $diskOptions
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return bool|PendingDispatch
|
||||
*/
|
||||
public function store(string $filePath = null, string $disk = null, string $writerType = null, $diskOptions = [])
|
||||
{
|
||||
$filePath = $filePath ?? $this->filePath ?? null;
|
||||
|
||||
if (null === $filePath) {
|
||||
throw NoFilePathGivenException::export();
|
||||
}
|
||||
|
||||
return $this->getExporter()->store(
|
||||
$this,
|
||||
$filePath,
|
||||
$disk ?? $this->disk ?? null,
|
||||
$writerType ?? $this->writerType ?? null,
|
||||
$diskOptions ?? $this->diskOptions ?? []
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $writerType
|
||||
* @param mixed $diskOptions
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return PendingDispatch
|
||||
*/
|
||||
public function queue(string $filePath = null, string $disk = null, string $writerType = null, $diskOptions = [])
|
||||
{
|
||||
$filePath = $filePath ?? $this->filePath ?? null;
|
||||
|
||||
if (null === $filePath) {
|
||||
throw NoFilePathGivenException::export();
|
||||
}
|
||||
|
||||
return $this->getExporter()->queue(
|
||||
$this,
|
||||
$filePath,
|
||||
$disk ?? $this->disk ?? null,
|
||||
$writerType ?? $this->writerType ?? null,
|
||||
$diskOptions ?? $this->diskOptions ?? []
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $writerType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function raw($writerType = null)
|
||||
{
|
||||
$writerType = $writerType ?? $this->writerType ?? null;
|
||||
|
||||
return $this->getExporter()->raw($this, $writerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an HTTP response that represents the object.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @throws NoFilenameGivenException
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function toResponse($request)
|
||||
{
|
||||
return $this->download();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Exporter
|
||||
*/
|
||||
private function getExporter(): Exporter
|
||||
{
|
||||
return app(Exporter::class);
|
||||
}
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/FromArray.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/FromArray.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface FromArray
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function array(): array;
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/FromCollection.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/FromCollection.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface FromCollection
|
||||
{
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function collection();
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/FromGenerator.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/FromGenerator.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Generator;
|
||||
|
||||
interface FromGenerator
|
||||
{
|
||||
/**
|
||||
* @return Generator
|
||||
*/
|
||||
public function generator(): Generator;
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/FromIterator.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/FromIterator.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Iterator;
|
||||
|
||||
interface FromIterator
|
||||
{
|
||||
/**
|
||||
* @return Iterator
|
||||
*/
|
||||
public function iterator(): Iterator;
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/FromQuery.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/FromQuery.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Database\Query\Builder;
|
||||
|
||||
interface FromQuery
|
||||
{
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
public function query();
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/FromView.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/FromView.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
interface FromView
|
||||
{
|
||||
/**
|
||||
* @return View
|
||||
*/
|
||||
public function view(): View;
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/HasReferencesToOtherSheets.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/HasReferencesToOtherSheets.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface HasReferencesToOtherSheets
|
||||
{
|
||||
}
|
149
vendor/maatwebsite/excel/src/Concerns/Importable.php
vendored
Normal file
149
vendor/maatwebsite/excel/src/Concerns/Importable.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Console\OutputStyle;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\PendingDispatch;
|
||||
use Illuminate\Support\Collection;
|
||||
use InvalidArgumentException;
|
||||
use Maatwebsite\Excel\Exceptions\NoFilePathGivenException;
|
||||
use Maatwebsite\Excel\Importer;
|
||||
use Symfony\Component\Console\Input\StringInput;
|
||||
use Symfony\Component\Console\Output\NullOutput;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
|
||||
trait Importable
|
||||
{
|
||||
/**
|
||||
* @var OutputStyle|null
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
/**
|
||||
* @param string|UploadedFile|null $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return Importer|PendingDispatch
|
||||
*/
|
||||
public function import($filePath = null, string $disk = null, string $readerType = null)
|
||||
{
|
||||
$filePath = $this->getFilePath($filePath);
|
||||
|
||||
return $this->getImporter()->import(
|
||||
$this,
|
||||
$filePath,
|
||||
$disk ?? $this->disk ?? null,
|
||||
$readerType ?? $this->readerType ?? null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|UploadedFile|null $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($filePath = null, string $disk = null, string $readerType = null): array
|
||||
{
|
||||
$filePath = $this->getFilePath($filePath);
|
||||
|
||||
return $this->getImporter()->toArray(
|
||||
$this,
|
||||
$filePath,
|
||||
$disk ?? $this->disk ?? null,
|
||||
$readerType ?? $this->readerType ?? null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|UploadedFile|null $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return Collection
|
||||
*/
|
||||
public function toCollection($filePath = null, string $disk = null, string $readerType = null): Collection
|
||||
{
|
||||
$filePath = $this->getFilePath($filePath);
|
||||
|
||||
return $this->getImporter()->toCollection(
|
||||
$this,
|
||||
$filePath,
|
||||
$disk ?? $this->disk ?? null,
|
||||
$readerType ?? $this->readerType ?? null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|UploadedFile|null $filePath
|
||||
* @param string|null $disk
|
||||
* @param string|null $readerType
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @throws InvalidArgumentException
|
||||
* @return PendingDispatch
|
||||
*/
|
||||
public function queue($filePath = null, string $disk = null, string $readerType = null)
|
||||
{
|
||||
if (!$this instanceof ShouldQueue) {
|
||||
throw new InvalidArgumentException('Importable should implement ShouldQueue to be queued.');
|
||||
}
|
||||
|
||||
return $this->import($filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OutputStyle $output
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function withOutput(OutputStyle $output)
|
||||
{
|
||||
$this->output = $output;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return OutputStyle
|
||||
*/
|
||||
public function getConsoleOutput(): OutputStyle
|
||||
{
|
||||
if (!$this->output instanceof OutputStyle) {
|
||||
$this->output = new OutputStyle(new StringInput(''), new NullOutput());
|
||||
}
|
||||
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param UploadedFile|string|null $filePath
|
||||
*
|
||||
* @throws NoFilePathGivenException
|
||||
* @return UploadedFile|string
|
||||
*/
|
||||
private function getFilePath($filePath = null)
|
||||
{
|
||||
$filePath = $filePath ?? $this->filePath ?? null;
|
||||
|
||||
if (null === $filePath) {
|
||||
throw NoFilePathGivenException::import();
|
||||
}
|
||||
|
||||
return $filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Importer
|
||||
*/
|
||||
private function getImporter(): Importer
|
||||
{
|
||||
return app(Importer::class);
|
||||
}
|
||||
}
|
69
vendor/maatwebsite/excel/src/Concerns/MapsCsvSettings.php
vendored
Normal file
69
vendor/maatwebsite/excel/src/Concerns/MapsCsvSettings.php
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
trait MapsCsvSettings
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $delimiter = ',';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $enclosure = '"';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $lineEnding = PHP_EOL;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected static $useBom = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected static $includeSeparatorLine = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected static $excelCompatibility = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $escapeCharacter = '\\';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected static $contiguous = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $inputEncoding = 'UTF-8';
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
*/
|
||||
public static function applyCsvSettings(array $config)
|
||||
{
|
||||
static::$delimiter = Arr::get($config, 'delimiter', static::$delimiter);
|
||||
static::$enclosure = Arr::get($config, 'enclosure', static::$enclosure);
|
||||
static::$lineEnding = Arr::get($config, 'line_ending', static::$lineEnding);
|
||||
static::$useBom = Arr::get($config, 'use_bom', static::$useBom);
|
||||
static::$includeSeparatorLine = Arr::get($config, 'include_separator_line', static::$includeSeparatorLine);
|
||||
static::$excelCompatibility = Arr::get($config, 'excel_compatibility', static::$excelCompatibility);
|
||||
static::$escapeCharacter = Arr::get($config, 'escape_character', static::$escapeCharacter);
|
||||
static::$contiguous = Arr::get($config, 'contiguous', static::$contiguous);
|
||||
static::$inputEncoding = Arr::get($config, 'input_encoding', static::$inputEncoding);
|
||||
}
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/OnEachRow.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/OnEachRow.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Maatwebsite\Excel\Row;
|
||||
|
||||
interface OnEachRow
|
||||
{
|
||||
/**
|
||||
* @param Row $row
|
||||
*/
|
||||
public function onRow(Row $row);
|
||||
}
|
52
vendor/maatwebsite/excel/src/Concerns/RegistersEventListeners.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Concerns/RegistersEventListeners.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Maatwebsite\Excel\Events\AfterImport;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use Maatwebsite\Excel\Events\BeforeExport;
|
||||
use Maatwebsite\Excel\Events\BeforeImport;
|
||||
use Maatwebsite\Excel\Events\BeforeSheet;
|
||||
use Maatwebsite\Excel\Events\BeforeWriting;
|
||||
use Maatwebsite\Excel\Events\ImportFailed;
|
||||
|
||||
trait RegistersEventListeners
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function registerEvents(): array
|
||||
{
|
||||
$listeners = [];
|
||||
|
||||
if (method_exists($this, 'beforeExport')) {
|
||||
$listeners[BeforeExport::class] = [static::class, 'beforeExport'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'beforeWriting')) {
|
||||
$listeners[BeforeWriting::class] = [static::class, 'beforeWriting'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'beforeImport')) {
|
||||
$listeners[BeforeImport::class] = [static::class, 'beforeImport'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'afterImport')) {
|
||||
$listeners[AfterImport::class] = [static::class, 'afterImport'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'importFailed')) {
|
||||
$listeners[ImportFailed::class] = [static::class, 'importFailed'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'beforeSheet')) {
|
||||
$listeners[BeforeSheet::class] = [static::class, 'beforeSheet'];
|
||||
}
|
||||
|
||||
if (method_exists($this, 'afterSheet')) {
|
||||
$listeners[AfterSheet::class] = [static::class, 'afterSheet'];
|
||||
}
|
||||
|
||||
return $listeners;
|
||||
}
|
||||
}
|
27
vendor/maatwebsite/excel/src/Concerns/RemembersChunkOffset.php
vendored
Normal file
27
vendor/maatwebsite/excel/src/Concerns/RemembersChunkOffset.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
trait RemembersChunkOffset
|
||||
{
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
protected $chunkOffset;
|
||||
|
||||
/**
|
||||
* @param int $chunkOffset
|
||||
*/
|
||||
public function setChunkOffset(int $chunkOffset)
|
||||
{
|
||||
$this->chunkOffset = $chunkOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChunkOffset()
|
||||
{
|
||||
return $this->chunkOffset;
|
||||
}
|
||||
}
|
27
vendor/maatwebsite/excel/src/Concerns/RemembersRowNumber.php
vendored
Normal file
27
vendor/maatwebsite/excel/src/Concerns/RemembersRowNumber.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
trait RemembersRowNumber
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $rowNumber;
|
||||
|
||||
/**
|
||||
* @param int $rowNumber
|
||||
*/
|
||||
public function rememberRowNumber(int $rowNumber)
|
||||
{
|
||||
$this->rowNumber = $rowNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getRowNumber()
|
||||
{
|
||||
return $this->rowNumber;
|
||||
}
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/ShouldAutoSize.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/ShouldAutoSize.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface ShouldAutoSize
|
||||
{
|
||||
}
|
9
vendor/maatwebsite/excel/src/Concerns/ShouldQueueWithoutChain.php
vendored
Normal file
9
vendor/maatwebsite/excel/src/Concerns/ShouldQueueWithoutChain.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
interface ShouldQueueWithoutChain extends ShouldQueue
|
||||
{
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/SkipsEmptyRows.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/SkipsEmptyRows.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface SkipsEmptyRows
|
||||
{
|
||||
}
|
30
vendor/maatwebsite/excel/src/Concerns/SkipsErrors.php
vendored
Normal file
30
vendor/maatwebsite/excel/src/Concerns/SkipsErrors.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Throwable;
|
||||
|
||||
trait SkipsErrors
|
||||
{
|
||||
/**
|
||||
* @var Throwable[]
|
||||
*/
|
||||
protected $errors = [];
|
||||
|
||||
/**
|
||||
* @param Throwable $e
|
||||
*/
|
||||
public function onError(Throwable $e)
|
||||
{
|
||||
$this->errors[] = $e;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Throwable[]|Collection
|
||||
*/
|
||||
public function errors(): Collection
|
||||
{
|
||||
return new Collection($this->errors);
|
||||
}
|
||||
}
|
30
vendor/maatwebsite/excel/src/Concerns/SkipsFailures.php
vendored
Normal file
30
vendor/maatwebsite/excel/src/Concerns/SkipsFailures.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Validators\Failure;
|
||||
|
||||
trait SkipsFailures
|
||||
{
|
||||
/**
|
||||
* @var Failure[]
|
||||
*/
|
||||
protected $failures = [];
|
||||
|
||||
/**
|
||||
* @param Failure ...$failures
|
||||
*/
|
||||
public function onFailure(Failure ...$failures)
|
||||
{
|
||||
$this->failures = array_merge($this->failures, $failures);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Failure[]|Collection
|
||||
*/
|
||||
public function failures(): Collection
|
||||
{
|
||||
return new Collection($this->failures);
|
||||
}
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/SkipsOnError.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/SkipsOnError.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Throwable;
|
||||
|
||||
interface SkipsOnError
|
||||
{
|
||||
/**
|
||||
* @param Throwable $e
|
||||
*/
|
||||
public function onError(Throwable $e);
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/SkipsOnFailure.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/SkipsOnFailure.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Maatwebsite\Excel\Validators\Failure;
|
||||
|
||||
interface SkipsOnFailure
|
||||
{
|
||||
/**
|
||||
* @param Failure[] $failures
|
||||
*/
|
||||
public function onFailure(Failure ...$failures);
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/SkipsUnknownSheets.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/SkipsUnknownSheets.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface SkipsUnknownSheets
|
||||
{
|
||||
/**
|
||||
* @param string|int $sheetName
|
||||
*/
|
||||
public function onUnknownSheet($sheetName);
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/ToArray.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/ToArray.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface ToArray
|
||||
{
|
||||
/**
|
||||
* @param array $array
|
||||
*/
|
||||
public function array(array $array);
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/ToCollection.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/ToCollection.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface ToCollection
|
||||
{
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function collection(Collection $collection);
|
||||
}
|
15
vendor/maatwebsite/excel/src/Concerns/ToModel.php
vendored
Normal file
15
vendor/maatwebsite/excel/src/Concerns/ToModel.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
interface ToModel
|
||||
{
|
||||
/**
|
||||
* @param array $row
|
||||
*
|
||||
* @return Model|Model[]|null
|
||||
*/
|
||||
public function model(array $row);
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithBatchInserts.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithBatchInserts.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithBatchInserts
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function batchSize(): int;
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/WithCalculatedFormulas.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/WithCalculatedFormulas.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithCalculatedFormulas
|
||||
{
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/WithCharts.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/WithCharts.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||
|
||||
interface WithCharts
|
||||
{
|
||||
/**
|
||||
* @return Chart|Chart[]
|
||||
*/
|
||||
public function charts();
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithChunkReading.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithChunkReading.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithChunkReading
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function chunkSize(): int;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithColumnFormatting.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithColumnFormatting.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithColumnFormatting
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function columnFormats(): array;
|
||||
}
|
8
vendor/maatwebsite/excel/src/Concerns/WithColumnLimit.php
vendored
Normal file
8
vendor/maatwebsite/excel/src/Concerns/WithColumnLimit.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithColumnLimit
|
||||
{
|
||||
public function endColumn(): string;
|
||||
}
|
8
vendor/maatwebsite/excel/src/Concerns/WithColumnWidths.php
vendored
Normal file
8
vendor/maatwebsite/excel/src/Concerns/WithColumnWidths.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithColumnWidths
|
||||
{
|
||||
public function columnWidths(): array;
|
||||
}
|
38
vendor/maatwebsite/excel/src/Concerns/WithConditionalSheets.php
vendored
Normal file
38
vendor/maatwebsite/excel/src/Concerns/WithConditionalSheets.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
trait WithConditionalSheets
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $conditionallySelectedSheets = [];
|
||||
|
||||
/**
|
||||
* @param string|array $sheets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function onlySheets($sheets)
|
||||
{
|
||||
$this->conditionallySelectedSheets = is_array($sheets) ? $sheets : func_get_args();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function sheets(): array
|
||||
{
|
||||
return \array_filter($this->conditionalSheets(), function ($name) {
|
||||
return \in_array($name, $this->conditionallySelectedSheets, false);
|
||||
}, ARRAY_FILTER_USE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
abstract public function conditionalSheets(): array;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithCustomChunkSize.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithCustomChunkSize.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithCustomChunkSize
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function chunkSize(): int;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithCustomCsvSettings.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithCustomCsvSettings.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithCustomCsvSettings
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getCsvSettings(): array;
|
||||
}
|
17
vendor/maatwebsite/excel/src/Concerns/WithCustomQuerySize.php
vendored
Normal file
17
vendor/maatwebsite/excel/src/Concerns/WithCustomQuerySize.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithCustomQuerySize
|
||||
{
|
||||
/**
|
||||
* Queued exportables are processed in chunks; each chunk being a job pushed to the queue by the QueuedWriter.
|
||||
* In case of exportables that implement the FromQuery concern, the number of jobs is calculated by dividing the $query->count() by the chunk size.
|
||||
* Depending on the implementation of the query() method (eg. When using a groupBy clause), this calculation might not be correct.
|
||||
*
|
||||
* When this is the case, you should use this method to provide a custom calculation of the query size.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function querySize(): int;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithCustomStartCell.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithCustomStartCell.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithCustomStartCell
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function startCell(): string;
|
||||
}
|
9
vendor/maatwebsite/excel/src/Concerns/WithCustomValueBinder.php
vendored
Normal file
9
vendor/maatwebsite/excel/src/Concerns/WithCustomValueBinder.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\IValueBinder;
|
||||
|
||||
interface WithCustomValueBinder extends IValueBinder
|
||||
{
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/WithDrawings.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/WithDrawings.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing;
|
||||
|
||||
interface WithDrawings
|
||||
{
|
||||
/**
|
||||
* @return BaseDrawing|BaseDrawing[]
|
||||
*/
|
||||
public function drawings();
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithEvents.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithEvents.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithEvents
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function registerEvents(): array;
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/WithFormatData.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/WithFormatData.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithFormatData
|
||||
{
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/WithHeadingRow.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/WithHeadingRow.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithHeadingRow
|
||||
{
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithHeadings.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithHeadings.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithHeadings
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function headings(): array;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithLimit.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithLimit.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithLimit
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function limit(): int;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithMappedCells.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithMappedCells.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithMappedCells
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function mapping(): array;
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/WithMapping.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/WithMapping.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithMapping
|
||||
{
|
||||
/**
|
||||
* @param mixed $row
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function map($row): array;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithMultipleSheets.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithMultipleSheets.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithMultipleSheets
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function sheets(): array;
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/WithPreCalculateFormulas.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/WithPreCalculateFormulas.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithPreCalculateFormulas
|
||||
{
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/WithProgressBar.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/WithProgressBar.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use Illuminate\Console\OutputStyle;
|
||||
|
||||
interface WithProgressBar
|
||||
{
|
||||
/**
|
||||
* @return OutputStyle
|
||||
*/
|
||||
public function getConsoleOutput(): OutputStyle;
|
||||
}
|
8
vendor/maatwebsite/excel/src/Concerns/WithProperties.php
vendored
Normal file
8
vendor/maatwebsite/excel/src/Concerns/WithProperties.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithProperties
|
||||
{
|
||||
public function properties(): array;
|
||||
}
|
13
vendor/maatwebsite/excel/src/Concerns/WithReadFilter.php
vendored
Normal file
13
vendor/maatwebsite/excel/src/Concerns/WithReadFilter.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Reader\IReadFilter;
|
||||
|
||||
interface WithReadFilter
|
||||
{
|
||||
/**
|
||||
* @return IReadFilter
|
||||
*/
|
||||
public function readFilter(): IReadFilter;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithStartRow.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithStartRow.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithStartRow
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function startRow(): int;
|
||||
}
|
7
vendor/maatwebsite/excel/src/Concerns/WithStrictNullComparison.php
vendored
Normal file
7
vendor/maatwebsite/excel/src/Concerns/WithStrictNullComparison.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithStrictNullComparison
|
||||
{
|
||||
}
|
10
vendor/maatwebsite/excel/src/Concerns/WithStyles.php
vendored
Normal file
10
vendor/maatwebsite/excel/src/Concerns/WithStyles.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
interface WithStyles
|
||||
{
|
||||
public function styles(Worksheet $sheet);
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithTitle.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithTitle.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithTitle
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string;
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithUpsertColumns.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithUpsertColumns.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithUpsertColumns
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function upsertColumns();
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithUpserts.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithUpserts.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithUpserts
|
||||
{
|
||||
/**
|
||||
* @return string|array
|
||||
*/
|
||||
public function uniqueBy();
|
||||
}
|
11
vendor/maatwebsite/excel/src/Concerns/WithValidation.php
vendored
Normal file
11
vendor/maatwebsite/excel/src/Concerns/WithValidation.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Concerns;
|
||||
|
||||
interface WithValidation
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array;
|
||||
}
|
95
vendor/maatwebsite/excel/src/Console/ExportMakeCommand.php
vendored
Executable file
95
vendor/maatwebsite/excel/src/Console/ExportMakeCommand.php
vendored
Executable file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Console;
|
||||
|
||||
use Illuminate\Console\GeneratorCommand;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
class ExportMakeCommand extends GeneratorCommand
|
||||
{
|
||||
use WithModelStub;
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'make:export';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create a new export class';
|
||||
|
||||
/**
|
||||
* The type of class being generated.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Export';
|
||||
|
||||
/**
|
||||
* Get the stub file for the generator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getStub()
|
||||
{
|
||||
if ($this->option('model') && $this->option('query')) {
|
||||
return $this->resolveStubPath('/stubs/export.query-model.stub');
|
||||
} elseif ($this->option('model')) {
|
||||
return $this->resolveStubPath('/stubs/export.model.stub');
|
||||
} elseif ($this->option('query')) {
|
||||
return $this->resolveStubPath('/stubs/export.query.stub');
|
||||
}
|
||||
|
||||
return $this->resolveStubPath('/stubs/export.plain.stub');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default namespace for the class.
|
||||
*
|
||||
* @param string $rootNamespace
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getDefaultNamespace($rootNamespace)
|
||||
{
|
||||
return $rootNamespace . '\Exports';
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the class with the given name.
|
||||
* Remove the base controller import if we are already in base namespace.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildClass($name)
|
||||
{
|
||||
$replace = [];
|
||||
if ($this->option('model')) {
|
||||
$replace = $this->buildModelReplacements($replace);
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
array_keys($replace), array_values($replace), parent::buildClass($name)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [
|
||||
['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate an export for the given model.'],
|
||||
['query', '', InputOption::VALUE_NONE, 'Generate an export for a query.'],
|
||||
];
|
||||
}
|
||||
}
|
88
vendor/maatwebsite/excel/src/Console/ImportMakeCommand.php
vendored
Executable file
88
vendor/maatwebsite/excel/src/Console/ImportMakeCommand.php
vendored
Executable file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Console;
|
||||
|
||||
use Illuminate\Console\GeneratorCommand;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
class ImportMakeCommand extends GeneratorCommand
|
||||
{
|
||||
use WithModelStub;
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'make:import';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create a new import class';
|
||||
|
||||
/**
|
||||
* The type of class being generated.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Import';
|
||||
|
||||
/**
|
||||
* Get the stub file for the generator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getStub()
|
||||
{
|
||||
return $this->option('model')
|
||||
? $this->resolveStubPath('/stubs/import.model.stub')
|
||||
: $this->resolveStubPath('/stubs/import.collection.stub');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default namespace for the class.
|
||||
*
|
||||
* @param string $rootNamespace
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getDefaultNamespace($rootNamespace)
|
||||
{
|
||||
return $rootNamespace . '\Imports';
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the class with the given name.
|
||||
* Remove the base controller import if we are already in base namespace.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildClass($name)
|
||||
{
|
||||
$replace = [];
|
||||
if ($this->option('model')) {
|
||||
$replace = $this->buildModelReplacements($replace);
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
array_keys($replace), array_values($replace), parent::buildClass($name)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [
|
||||
['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate an import for the given model.'],
|
||||
];
|
||||
}
|
||||
}
|
61
vendor/maatwebsite/excel/src/Console/WithModelStub.php
vendored
Normal file
61
vendor/maatwebsite/excel/src/Console/WithModelStub.php
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Console;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use InvalidArgumentException;
|
||||
|
||||
trait WithModelStub
|
||||
{
|
||||
/**
|
||||
* Build the model replacement values.
|
||||
*
|
||||
* @param array $replace
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function buildModelReplacements(array $replace): array
|
||||
{
|
||||
$modelClass = $this->parseModel($this->option('model'));
|
||||
|
||||
return array_merge($replace, [
|
||||
'DummyFullModelClass' => $modelClass,
|
||||
'DummyModelClass' => class_basename($modelClass),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fully-qualified model class name.
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseModel($model): string
|
||||
{
|
||||
if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) {
|
||||
throw new InvalidArgumentException('Model name contains invalid characters.');
|
||||
}
|
||||
|
||||
$model = trim(str_replace('/', '\\', $model), '\\');
|
||||
|
||||
if (!Str::startsWith($model, $rootNamespace = $this->laravel->getNamespace())) {
|
||||
$model = $rootNamespace . $model;
|
||||
}
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the fully-qualified path to the stub.
|
||||
*
|
||||
* @param string $stub
|
||||
* @return string
|
||||
*/
|
||||
protected function resolveStubPath($stub)
|
||||
{
|
||||
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
|
||||
? $customPath
|
||||
: __DIR__ . $stub;
|
||||
}
|
||||
}
|
17
vendor/maatwebsite/excel/src/Console/stubs/export.model.stub
vendored
Normal file
17
vendor/maatwebsite/excel/src/Console/stubs/export.model.stub
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use DummyFullModelClass;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
|
||||
class DummyClass implements FromCollection
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return DummyModelClass::all();
|
||||
}
|
||||
}
|
16
vendor/maatwebsite/excel/src/Console/stubs/export.plain.stub
vendored
Normal file
16
vendor/maatwebsite/excel/src/Console/stubs/export.plain.stub
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
|
||||
class DummyClass implements FromCollection
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
17
vendor/maatwebsite/excel/src/Console/stubs/export.query-model.stub
vendored
Normal file
17
vendor/maatwebsite/excel/src/Console/stubs/export.query-model.stub
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use DummyFullModelClass;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
|
||||
class DummyClass implements FromQuery
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
return DummyModelClass::query();
|
||||
}
|
||||
}
|
16
vendor/maatwebsite/excel/src/Console/stubs/export.query.stub
vendored
Normal file
16
vendor/maatwebsite/excel/src/Console/stubs/export.query.stub
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
|
||||
class DummyClass implements FromQuery
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
17
vendor/maatwebsite/excel/src/Console/stubs/import.collection.stub
vendored
Normal file
17
vendor/maatwebsite/excel/src/Console/stubs/import.collection.stub
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||
|
||||
class DummyClass implements ToCollection
|
||||
{
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function collection(Collection $collection)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
21
vendor/maatwebsite/excel/src/Console/stubs/import.model.stub
vendored
Normal file
21
vendor/maatwebsite/excel/src/Console/stubs/import.model.stub
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use DummyFullModelClass;
|
||||
use Maatwebsite\Excel\Concerns\ToModel;
|
||||
|
||||
class DummyClass implements ToModel
|
||||
{
|
||||
/**
|
||||
* @param array $row
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Model|null
|
||||
*/
|
||||
public function model(array $row)
|
||||
{
|
||||
return new DummyModelClass([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
24
vendor/maatwebsite/excel/src/DefaultValueBinder.php
vendored
Normal file
24
vendor/maatwebsite/excel/src/DefaultValueBinder.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder as PhpSpreadsheetDefaultValueBinder;
|
||||
|
||||
class DefaultValueBinder extends PhpSpreadsheetDefaultValueBinder
|
||||
{
|
||||
/**
|
||||
* @param Cell $cell Cell to bind value to
|
||||
* @param mixed $value Value to bind in cell
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bindValue(Cell $cell, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
$value = \json_encode($value);
|
||||
}
|
||||
|
||||
return parent::bindValue($cell, $value);
|
||||
}
|
||||
}
|
36
vendor/maatwebsite/excel/src/DelegatedMacroable.php
vendored
Normal file
36
vendor/maatwebsite/excel/src/DelegatedMacroable.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
|
||||
trait DelegatedMacroable
|
||||
{
|
||||
use Macroable {
|
||||
__call as __callMacro;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamically handle calls to the class.
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
if (method_exists($this->getDelegate(), $method)) {
|
||||
return call_user_func_array([$this->getDelegate(), $method], $parameters);
|
||||
}
|
||||
|
||||
array_unshift($parameters, $this);
|
||||
|
||||
return $this->__callMacro($method, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
abstract public function getDelegate();
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/AfterImport.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/AfterImport.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Reader;
|
||||
|
||||
class AfterImport extends Event
|
||||
{
|
||||
/**
|
||||
* @var Reader
|
||||
*/
|
||||
public $reader;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $importable;
|
||||
|
||||
/**
|
||||
* @param Reader $reader
|
||||
* @param object $importable
|
||||
*/
|
||||
public function __construct(Reader $reader, $importable)
|
||||
{
|
||||
$this->reader = $reader;
|
||||
$this->importable = $importable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Reader
|
||||
*/
|
||||
public function getReader(): Reader
|
||||
{
|
||||
return $this->reader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->importable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->reader;
|
||||
}
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/AfterSheet.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/AfterSheet.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Sheet;
|
||||
|
||||
class AfterSheet extends Event
|
||||
{
|
||||
/**
|
||||
* @var Sheet
|
||||
*/
|
||||
public $sheet;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $exportable;
|
||||
|
||||
/**
|
||||
* @param Sheet $sheet
|
||||
* @param object $exportable
|
||||
*/
|
||||
public function __construct(Sheet $sheet, $exportable)
|
||||
{
|
||||
$this->sheet = $sheet;
|
||||
$this->exportable = $exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Sheet
|
||||
*/
|
||||
public function getSheet(): Sheet
|
||||
{
|
||||
return $this->sheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->sheet;
|
||||
}
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/BeforeExport.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/BeforeExport.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Writer;
|
||||
|
||||
class BeforeExport extends Event
|
||||
{
|
||||
/**
|
||||
* @var Writer
|
||||
*/
|
||||
public $writer;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $exportable;
|
||||
|
||||
/**
|
||||
* @param Writer $writer
|
||||
* @param object $exportable
|
||||
*/
|
||||
public function __construct(Writer $writer, $exportable)
|
||||
{
|
||||
$this->writer = $writer;
|
||||
$this->exportable = $exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Writer
|
||||
*/
|
||||
public function getWriter(): Writer
|
||||
{
|
||||
return $this->writer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->writer;
|
||||
}
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/BeforeImport.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/BeforeImport.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Reader;
|
||||
|
||||
class BeforeImport extends Event
|
||||
{
|
||||
/**
|
||||
* @var Reader
|
||||
*/
|
||||
public $reader;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $importable;
|
||||
|
||||
/**
|
||||
* @param Reader $reader
|
||||
* @param object $importable
|
||||
*/
|
||||
public function __construct(Reader $reader, $importable)
|
||||
{
|
||||
$this->reader = $reader;
|
||||
$this->importable = $importable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Reader
|
||||
*/
|
||||
public function getReader(): Reader
|
||||
{
|
||||
return $this->reader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->importable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->reader;
|
||||
}
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/BeforeSheet.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/BeforeSheet.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Sheet;
|
||||
|
||||
class BeforeSheet extends Event
|
||||
{
|
||||
/**
|
||||
* @var Sheet
|
||||
*/
|
||||
public $sheet;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $exportable;
|
||||
|
||||
/**
|
||||
* @param Sheet $sheet
|
||||
* @param object $exportable
|
||||
*/
|
||||
public function __construct(Sheet $sheet, $exportable)
|
||||
{
|
||||
$this->sheet = $sheet;
|
||||
$this->exportable = $exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Sheet
|
||||
*/
|
||||
public function getSheet(): Sheet
|
||||
{
|
||||
return $this->sheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->sheet;
|
||||
}
|
||||
}
|
52
vendor/maatwebsite/excel/src/Events/BeforeWriting.php
vendored
Normal file
52
vendor/maatwebsite/excel/src/Events/BeforeWriting.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Maatwebsite\Excel\Writer;
|
||||
|
||||
class BeforeWriting extends Event
|
||||
{
|
||||
/**
|
||||
* @var Writer
|
||||
*/
|
||||
public $writer;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
private $exportable;
|
||||
|
||||
/**
|
||||
* @param Writer $writer
|
||||
* @param object $exportable
|
||||
*/
|
||||
public function __construct(Writer $writer, $exportable)
|
||||
{
|
||||
$this->writer = $writer;
|
||||
$this->exportable = $exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Writer
|
||||
*/
|
||||
public function getWriter(): Writer
|
||||
{
|
||||
return $this->writer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
public function getConcernable()
|
||||
{
|
||||
return $this->exportable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDelegate()
|
||||
{
|
||||
return $this->writer;
|
||||
}
|
||||
}
|
26
vendor/maatwebsite/excel/src/Events/Event.php
vendored
Normal file
26
vendor/maatwebsite/excel/src/Events/Event.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
abstract class Event
|
||||
{
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
abstract public function getConcernable();
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function getDelegate();
|
||||
|
||||
/**
|
||||
* @param string $concern
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function appliesToConcern(string $concern): bool
|
||||
{
|
||||
return $this->getConcernable() instanceof $concern;
|
||||
}
|
||||
}
|
29
vendor/maatwebsite/excel/src/Events/ImportFailed.php
vendored
Normal file
29
vendor/maatwebsite/excel/src/Events/ImportFailed.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Events;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class ImportFailed
|
||||
{
|
||||
/**
|
||||
* @var Throwable
|
||||
*/
|
||||
public $e;
|
||||
|
||||
/**
|
||||
* @param Throwable $e
|
||||
*/
|
||||
public function __construct(Throwable $e)
|
||||
{
|
||||
$this->e = $e;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Throwable
|
||||
*/
|
||||
public function getException(): Throwable
|
||||
{
|
||||
return $this->e;
|
||||
}
|
||||
}
|
197
vendor/maatwebsite/excel/src/Excel.php
vendored
Normal file
197
vendor/maatwebsite/excel/src/Excel.php
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\PendingDispatch;
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Files\Filesystem;
|
||||
use Maatwebsite\Excel\Files\TemporaryFile;
|
||||
use Maatwebsite\Excel\Helpers\FileTypeDetector;
|
||||
|
||||
class Excel implements Exporter, Importer
|
||||
{
|
||||
use RegistersCustomConcerns;
|
||||
|
||||
const XLSX = 'Xlsx';
|
||||
|
||||
const CSV = 'Csv';
|
||||
|
||||
const TSV = 'Csv';
|
||||
|
||||
const ODS = 'Ods';
|
||||
|
||||
const XLS = 'Xls';
|
||||
|
||||
const SLK = 'Slk';
|
||||
|
||||
const XML = 'Xml';
|
||||
|
||||
const GNUMERIC = 'Gnumeric';
|
||||
|
||||
const HTML = 'Html';
|
||||
|
||||
const MPDF = 'Mpdf';
|
||||
|
||||
const DOMPDF = 'Dompdf';
|
||||
|
||||
const TCPDF = 'Tcpdf';
|
||||
|
||||
/**
|
||||
* @var Writer
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
/**
|
||||
* @var QueuedWriter
|
||||
*/
|
||||
protected $queuedWriter;
|
||||
|
||||
/**
|
||||
* @var Filesystem
|
||||
*/
|
||||
protected $filesystem;
|
||||
|
||||
/**
|
||||
* @var Reader
|
||||
*/
|
||||
private $reader;
|
||||
|
||||
/**
|
||||
* @param Writer $writer
|
||||
* @param QueuedWriter $queuedWriter
|
||||
* @param Reader $reader
|
||||
* @param Filesystem $filesystem
|
||||
*/
|
||||
public function __construct(
|
||||
Writer $writer,
|
||||
QueuedWriter $queuedWriter,
|
||||
Reader $reader,
|
||||
Filesystem $filesystem
|
||||
) {
|
||||
$this->writer = $writer;
|
||||
$this->reader = $reader;
|
||||
$this->filesystem = $filesystem;
|
||||
$this->queuedWriter = $queuedWriter;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function download($export, string $fileName, string $writerType = null, array $headers = [])
|
||||
{
|
||||
return response()->download(
|
||||
$this->export($export, $fileName, $writerType)->getLocalPath(),
|
||||
$fileName,
|
||||
$headers
|
||||
)->deleteFileAfterSend(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function store($export, string $filePath, string $diskName = null, string $writerType = null, $diskOptions = [])
|
||||
{
|
||||
if ($export instanceof ShouldQueue) {
|
||||
return $this->queue($export, $filePath, $diskName, $writerType, $diskOptions);
|
||||
}
|
||||
|
||||
$temporaryFile = $this->export($export, $filePath, $writerType);
|
||||
|
||||
$exported = $this->filesystem->disk($diskName, $diskOptions)->copy(
|
||||
$temporaryFile,
|
||||
$filePath
|
||||
);
|
||||
|
||||
$temporaryFile->delete();
|
||||
|
||||
return $exported;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function queue($export, string $filePath, string $disk = null, string $writerType = null, $diskOptions = [])
|
||||
{
|
||||
$writerType = FileTypeDetector::detectStrict($filePath, $writerType);
|
||||
|
||||
return $this->queuedWriter->store(
|
||||
$export,
|
||||
$filePath,
|
||||
$disk,
|
||||
$writerType,
|
||||
$diskOptions
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function raw($export, string $writerType)
|
||||
{
|
||||
$temporaryFile = $this->writer->export($export, $writerType);
|
||||
|
||||
$contents = $temporaryFile->contents();
|
||||
$temporaryFile->delete();
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function import($import, $filePath, string $disk = null, string $readerType = null)
|
||||
{
|
||||
$readerType = FileTypeDetector::detect($filePath, $readerType);
|
||||
$response = $this->reader->read($import, $filePath, $readerType, $disk);
|
||||
|
||||
if ($response instanceof PendingDispatch) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toArray($import, $filePath, string $disk = null, string $readerType = null): array
|
||||
{
|
||||
$readerType = FileTypeDetector::detect($filePath, $readerType);
|
||||
|
||||
return $this->reader->toArray($import, $filePath, $readerType, $disk);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toCollection($import, $filePath, string $disk = null, string $readerType = null): Collection
|
||||
{
|
||||
$readerType = FileTypeDetector::detect($filePath, $readerType);
|
||||
|
||||
return $this->reader->toCollection($import, $filePath, $readerType, $disk);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function queueImport(ShouldQueue $import, $filePath, string $disk = null, string $readerType = null)
|
||||
{
|
||||
return $this->import($import, $filePath, $disk, $readerType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $export
|
||||
* @param string|null $fileName
|
||||
* @param string $writerType
|
||||
*
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||
* @return TemporaryFile
|
||||
*/
|
||||
protected function export($export, string $fileName, string $writerType = null): TemporaryFile
|
||||
{
|
||||
$writerType = FileTypeDetector::detectStrict($fileName, $writerType);
|
||||
|
||||
return $this->writer->export($export, $writerType);
|
||||
}
|
||||
}
|
117
vendor/maatwebsite/excel/src/ExcelServiceProvider.php
vendored
Normal file
117
vendor/maatwebsite/excel/src/ExcelServiceProvider.php
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Lumen\Application as LumenApplication;
|
||||
use Maatwebsite\Excel\Cache\CacheManager;
|
||||
use Maatwebsite\Excel\Console\ExportMakeCommand;
|
||||
use Maatwebsite\Excel\Console\ImportMakeCommand;
|
||||
use Maatwebsite\Excel\Files\Filesystem;
|
||||
use Maatwebsite\Excel\Files\TemporaryFileFactory;
|
||||
use Maatwebsite\Excel\Mixins\DownloadCollection;
|
||||
use Maatwebsite\Excel\Mixins\StoreCollection;
|
||||
use Maatwebsite\Excel\Transactions\TransactionHandler;
|
||||
use Maatwebsite\Excel\Transactions\TransactionManager;
|
||||
|
||||
class ExcelServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->publishes([
|
||||
__DIR__ . '/Console/stubs/export.model.stub' => base_path('stubs/export.model.stub'),
|
||||
__DIR__ . '/Console/stubs/export.plain.stub' => base_path('stubs/export.plain.stub'),
|
||||
__DIR__ . '/Console/stubs/export.query.stub' => base_path('stubs/export.query.stub'),
|
||||
__DIR__ . '/Console/stubs/export.query-model.stub' => base_path('stubs/export.query-model.stub'),
|
||||
__DIR__ . '/Console/stubs/import.collection.stub' => base_path('stubs/import.collection.stub'),
|
||||
__DIR__ . '/Console/stubs/import.model.stub' => base_path('stubs/import.model.stub'),
|
||||
], 'stubs');
|
||||
|
||||
if ($this->app instanceof LumenApplication) {
|
||||
$this->app->configure('excel');
|
||||
} else {
|
||||
$this->publishes([
|
||||
$this->getConfigFile() => config_path('excel.php'),
|
||||
], 'config');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->app instanceof \Illuminate\Foundation\Application) {
|
||||
// Laravel
|
||||
$this->app->booted(function ($app) {
|
||||
$app->make(SettingsProvider::class)->provide();
|
||||
});
|
||||
} else {
|
||||
// Lumen
|
||||
$this->app->make(SettingsProvider::class)->provide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->mergeConfigFrom(
|
||||
$this->getConfigFile(),
|
||||
'excel'
|
||||
);
|
||||
|
||||
$this->app->bind(CacheManager::class, function ($app) {
|
||||
return new CacheManager($app);
|
||||
});
|
||||
|
||||
$this->app->bind(TransactionManager::class, function ($app) {
|
||||
return new TransactionManager($app);
|
||||
});
|
||||
|
||||
$this->app->bind(TransactionHandler::class, function ($app) {
|
||||
return $app->make(TransactionManager::class)->driver();
|
||||
});
|
||||
|
||||
$this->app->bind(TemporaryFileFactory::class, function () {
|
||||
return new TemporaryFileFactory(
|
||||
config('excel.temporary_files.local_path', config('excel.exports.temp_path', storage_path('framework/laravel-excel'))),
|
||||
config('excel.temporary_files.remote_disk')
|
||||
);
|
||||
});
|
||||
|
||||
$this->app->bind(Filesystem::class, function ($app) {
|
||||
return new Filesystem($app->make('filesystem'));
|
||||
});
|
||||
|
||||
$this->app->bind('excel', function ($app) {
|
||||
return new Excel(
|
||||
$app->make(Writer::class),
|
||||
$app->make(QueuedWriter::class),
|
||||
$app->make(Reader::class),
|
||||
$app->make(Filesystem::class)
|
||||
);
|
||||
});
|
||||
|
||||
$this->app->alias('excel', Excel::class);
|
||||
$this->app->alias('excel', Exporter::class);
|
||||
$this->app->alias('excel', Importer::class);
|
||||
|
||||
Collection::mixin(new DownloadCollection);
|
||||
Collection::mixin(new StoreCollection);
|
||||
|
||||
$this->commands([
|
||||
ExportMakeCommand::class,
|
||||
ImportMakeCommand::class,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getConfigFile(): string
|
||||
{
|
||||
return __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'excel.php';
|
||||
}
|
||||
}
|
16
vendor/maatwebsite/excel/src/Exceptions/ConcernConflictException.php
vendored
Normal file
16
vendor/maatwebsite/excel/src/Exceptions/ConcernConflictException.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Exceptions;
|
||||
|
||||
use LogicException;
|
||||
|
||||
class ConcernConflictException extends LogicException implements LaravelExcelException
|
||||
{
|
||||
/**
|
||||
* @return ConcernConflictException
|
||||
*/
|
||||
public static function queryOrCollectionAndView()
|
||||
{
|
||||
return new static('Cannot use FromQuery, FromArray or FromCollection and FromView on the same sheet.');
|
||||
}
|
||||
}
|
9
vendor/maatwebsite/excel/src/Exceptions/LaravelExcelException.php
vendored
Normal file
9
vendor/maatwebsite/excel/src/Exceptions/LaravelExcelException.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Exceptions;
|
||||
|
||||
use Throwable;
|
||||
|
||||
interface LaravelExcelException extends Throwable
|
||||
{
|
||||
}
|
38
vendor/maatwebsite/excel/src/Exceptions/NoFilePathGivenException.php
vendored
Normal file
38
vendor/maatwebsite/excel/src/Exceptions/NoFilePathGivenException.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Throwable;
|
||||
|
||||
class NoFilePathGivenException extends InvalidArgumentException implements LaravelExcelException
|
||||
{
|
||||
/**
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(
|
||||
$message = 'A filepath needs to be passed.',
|
||||
$code = 0,
|
||||
Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NoFilePathGivenException
|
||||
*/
|
||||
public static function import()
|
||||
{
|
||||
return new static('A filepath or UploadedFile needs to be passed to start the import.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NoFilePathGivenException
|
||||
*/
|
||||
public static function export()
|
||||
{
|
||||
return new static('A filepath needs to be passed in order to store the export.');
|
||||
}
|
||||
}
|
22
vendor/maatwebsite/excel/src/Exceptions/NoFilenameGivenException.php
vendored
Normal file
22
vendor/maatwebsite/excel/src/Exceptions/NoFilenameGivenException.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Throwable;
|
||||
|
||||
class NoFilenameGivenException extends InvalidArgumentException implements LaravelExcelException
|
||||
{
|
||||
/**
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(
|
||||
$message = 'A filename needs to be passed in order to download the export',
|
||||
$code = 0,
|
||||
Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
22
vendor/maatwebsite/excel/src/Exceptions/NoTypeDetectedException.php
vendored
Normal file
22
vendor/maatwebsite/excel/src/Exceptions/NoTypeDetectedException.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Maatwebsite\Excel\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
class NoTypeDetectedException extends Exception implements LaravelExcelException
|
||||
{
|
||||
/**
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Throwable|null $previous
|
||||
*/
|
||||
public function __construct(
|
||||
$message = 'No ReaderType or WriterType could be detected. Make sure you either pass a valid extension to the filename or pass an explicit type.',
|
||||
$code = 0,
|
||||
Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user