We are happy to have reached this milestone and thank you all for using our package over the last 6,5 years! Cheers to many more imports and exports!
Table of Contents
In other news, we have released Laravel Excel 3.1.20 with some improvements for running imports on Vapor and working with row numbers, along with some fixes and changes. You can find a write up about this new release here.
When dealing with a multi server setup (and thus using a remote temporary file), 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 (This is especially an issue with Vapor).
To mitigate this you can set the new config settings (force_resync_remote
) to true. After every queued chunk the local temporary file will be deleted on the server that processed it. Without this setting it will only happen at the end of the process.
A new trait was added that helps keeping track of the current row number. This can be especially useful when dealing with the ToModel concern. You can get the current row number by using the `$this->rowNumber` property.
In additional to the row number trait also a chunk offset trait was added. It keeps track of the start row of the current chunk. This can be especially helpful when dealing with Chunked Imports.
Another addition is the WithColumnFilter
concern, it allows to specify an end column. This can be useful if you only want to read a very specific range of columns.
Behind the scenes read filters are used for chunk reading and the row limit concern. In some cases you might want to filter or skip rows yourself. You can do now by implementing the WithReadFilter
concern.
In your export:
It’s now possible to publish the stubs that are used when using the php artisan make:import
and php artisan make:export
commands so you can change them to your liking.
php artisan stub:publish
(Laravel 7.x)
The InteractsWithQueue trait was added to the ReadChunk job. The trait allows for the job to be released back onto the queue, useful for instance if using it with the funnel or throttle methods on the Redis facade.
It’s possible to specify a retry until method and add middleware to the import:
More about job middleware can be found in the Laravel documentation: https://laravel.com/docs/7.x/queues#job-middleware
This release also added support for combining those concerns and works in a similar fashion as for Model imports.
WithLimit concern and HeadingRowImport now use read filter, which means it will now only read the necessary rows.
The minimum version of PhpSpreadsheet was bumped to 1.14.
Read more about the package at: https://laravel-excel.com/
Don’t forget to send us a postcard of your hometown if you use Laravel Excel. We love to receive them!
Maatwebsite
Markt 2
6231 LS Meerssen
The Netherlands
This content was originally published here.
Facial recognition, once a staple of science fiction, is rapidly becoming a reality. In 2019,…
The recruitment picture is changing rapidly, and AI in recruitment is at the forefront of…
Multimodal AI is a groundbreaking technology that combines multiple modalities, such as text, images, and…
Artificial intelligence (AI in the energy) sector is revolutionizing how we produce, distribute, and consume…
Nowadays, monetization application is the end game of mobile app development. Whether you're an indie…
Nowadays, many mobile apps fail to make an impact. From poor research to bad user…