Excel export

"Export" writes the filtered list to an .xlsx file with its columns; more exports have their own columns, file name and query.

The code

app/src/Controllers/ProjectController.php – defineExports() whole file
/**
* Besides "Export" (the list's columns): a budget sheet with its own
* columns and file name.
*/
protected function defineExports(): array
{
return [
Export::create('budget', 'Budget sheet')
->fileName('Budgets ' . date('Y'))
->columns(fn () => ColumnCollection::create()
->make('Client.Name', 'Client')->width(30)->end()
->make('Title', 'Project')->width(40)->end()
->make('StatusLabel', 'Status')->end()
->make('Budget', 'Budget (€)')->width(14)->end())
->query(fn (DataList $list) => $list->exclude('Status', 'lead')->sort('Client.Name')),
];
}