filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.39k stars 2.97k forks source link

feat: allow limiting column map in exports #14853

Open ralphjsmit opened 1 day ago

ralphjsmit commented 1 day ago

Description

This PR adds the option to limit the ExportAction to certain columns. Previously, the only choice we had to limit columns was to have a column mapping form where the user can choose columns. However, sometimes we either want the column mapping form not to show all columns, or to not show a column mapping form and directly export a subset of columns.

This adds a ->columns() method that will allow the user to either:

Basically the four choices are now:

// Show column mapping form, include all columns
// Show column mapping form, include only specified columns
->columns(['id', 'full_name', 'email'])
// Hide column mapping form, export all columns
->columnMapping(false)
// Hide column mapping form, export specified columns
->columns(['id', 'full_name', 'email'])
->columnMapping(false)

Functional changes

zepfietje commented 1 day ago

Been thinking about this before but didn't find the chance to work on it. I think this is the missing piece for exports! 🚀