'How to export all rows using Export Buttons of Backpack Laravel?
I'm looking to export all rows of users table using the export button
of Backpack
in Laravel
. Currently the export button
only exports the lignes of 10 rows
showed, and i need to choose show all
if i want to export all of the rows. How can i achieve that?
Solution 1:[1]
There's no easy way to do that using the existing export functionality. Backpack uses DataTables' export, which is JS-based, so limited to the rows visible on the page.
You can, however, create a custom Backpack operation, that will export all rows in the format you want using PHP, and show a button on the table view. You'd have to code your own PHP logic for it, though.
Solution 2:[2]
edit this file
/var/www/html/omw/vendor/backpack/crud/src/resources/views/crud/inc/export_buttons.blade.php
just copy code on line no-12 to 99 and past on line no-12 and change this
return $(node).attr('data-visible-in-table') == 'false' && $(node).attr('data-can-be-visible-in-table') == 'true';
to
return true
;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | tabacitu |
Solution 2 | nixon1333 |