feat: add withoutGeneratedColumns() to exclude auto-generated columns #266
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing information
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-excel!266
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/without-generated-columns"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR introduces a new method
withoutGeneratedColumns()to theWithColumnsconcern. It allows developers to explicitly disable automatically generated columns when exporting data.Motivation
Currently, when using
->fromTable()or similar helpers, columns may be auto-generated based on the table definition or model attributes. While methods like->only()and->except()exist, they still operate on the final resolved column set, which may include implicitly generated columns.There is no straightforward way to completely opt out of generated columns and rely solely on manually defined columns via
->withColumns().This leads to:
except([])oronly([])Hey,
thanks for the PR, but I don't really understand what you are trying to do. Those helpers are there to add those columns automatically. It doesn't really make sense to apply them and then remove the columns again. Why don't you just use it without the helper?
I know, the default has
->fromTable()applied, but it's not too hard to overwrite. I'd rather document it more clearly, than add another method.Best,
Dennis
I’m so sorry. I misunderstood. I thought
fromTablewas a method for configuring the resource.I’ve learned that when referencing a table’s resource, it’s sufficient to just use
ExportBulkAction.I apologize for taking up your valuable time.
->fromTable()does two things: Apply the table query and configure the columns. If you only want the first you can do it via->useTableQuery().Thanks for the time to open a PR anyway!
Pull request closed