I have installed laravel backpack on my local. I am trying to modify the filename of exported file with this format TableName _YYYY-MM-DD HH:MM:SS. But can't find the option to do that in backpack.
Here's what I add for adding the export button in my table Controller.
$this->crud->enableExportButtons();
To my knowledge, the exported file is created in the client, it's a DataTables feature, that's why you can set a custom filename in the
export_buttons.blade.phpview file.The vendor file is
vendor/backpack/crud/src/resources/views/crud/inc/export_buttons.blade.php, you should probably copy that toresources/views/vendor/backpack/crud/inc/export_buttons.blade.phpand edit the latter.There is an array of buttons in the config options of
window.crud.dataTableConfiguration.buttons. Each of the buttons has multiple properties likename,extend,exportOptions,action. Add another optiontitleto the button you want to set the filename for.title: '{{$crud->model->getTable().'_'.now()->format('Y-m-d H:i:s')}}',will get you something pretty close to what you want I hope.