Download the PHP package thomascombe/backpack-async-export without Composer
On this page you can find all versions of the php package thomascombe/backpack-async-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thomascombe/backpack-async-export
More information about thomascombe/backpack-async-export
Files in thomascombe/backpack-async-export
Package backpack-async-export
Short Description This is a package to manage async export in Backpack for Laravel
License MIT
Homepage https://github.com/thomascombe/backpack_async_export
Informations about the package backpack-async-export
Laravel Backpack Async Export
This is a package to manage async export and import in Backpack for Laravel
Installation
You can install the package via composer:
Version | PHP | Laravel | Backpack |
---|---|---|---|
1.x | 7.4 - ^8.0 | ^8.0 - ^9.0 - ^10.0 | 4.1.* - ~5.0 |
2.x | ^8.1 | ^9.0 - ^10.0 | ~5.5 - ~6.0 |
3.x | ^8.1 | ^10.0 | ~6.0 |
4.x | ^8.2 | ^11.0 | ~6.0 |
You can publish and run the migrations with:
You can publish the config file with:
This is the contents of the published config file:
Usage for export
Add export item in menu
Create you export class
For all details, have a look at Laravel Excel Package.
You can make your export class extends our LaravelExcel abstract.
Create your controller
Your controller need to implement interface
Use awesome trait
Call method to add buttons
Add method to your CRUD controller
Simple csv export
It may sometimes be necessary to export large amounts of data. PhpSpreadsheet (used behind the hood by this package) does not always offer the best performance. In this case, it is recommended to use the low-level functions of PHP, such as fputcsv.
This package has an abstract class SimpleCsv which can be extended to use this export mode. Of course, it is more limited and only allows you to define a query, headers and a mapping between the model and the data table to be exported.
Usage for import
Add import item in menu
Create you import class
For all details, have a look at Laravel Excel Package
Create your controller
Your controller need to implement interface
Use awesome trait
Call method to add buttons
Add method to your CRUD controller
Need more?
Override ImportExport model
You can override ImportExport
model using config : import_export_model
.
Your model class need to implement \Thomascombe\BackpackAsyncExport\Models\ImportExport
.
Update export name
Package allow to change export name with interface on your export
class: Thomascombe\BackpackAsyncExport\Exports\ExportWithName
Multi export by CRUD?
You can easily have multi export on save CRUD.
Your CRUD controller need to
implement Thomascombe\BackpackAsyncExport\Http\Controllers\Admin\Interfaces\MultiExportableCrud
interface.
Array keys: key for query params and dynamic method name
Array values: Export name (display in CRUD button)
For each new export you have to add news methods:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- thomascombe
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of backpack-async-export with dependencies
backpack/crud Version ~6.0
illuminate/contracts Version ^11.0
maatwebsite/excel Version ^3.1
spatie/laravel-package-tools Version ^1.12