Issue with Table Joins in Exports
Hi everyone,
I'm encountering an issue when working with Filament's
- The
- It seems like the export is only pulling fields defined in the model, ignoring any additional columns from the query.
Context: - The same logic works perfectly in a Resource table using
Does anyone know if there’s a limitation in how
I’d appreciate any advice or insight on how to resolve this!
modifyQuery
method for Exports. Specifically, when I try to include table joins or additional query logic (e.g., grouping or calculated columns), the export doesn’t seem to reflect the expected data.
Here’s an example of my modifyQuery
implementation:
I’ve added the column to the export like this:
But when I export, the created_by_name
column isn’t filled at all. For additional debugging, I added the following:
What I noticed:- The
$record
object only includes data directly from the model/table (e.g., holds
), and none of the computed or joined columns (created_by_name
) are present.- It seems like the export is only pulling fields defined in the model, ignoring any additional columns from the query.
Context: - The same logic works perfectly in a Resource table using
getEloquentQuery
, although this doesn't transfer to the export.
- It seems that the modifyQuery
method doesn’t affect what data is passed to the export columns.Does anyone know if there’s a limitation in how
modifyQuery
interacts with exports? Or am I missing something about how to include computed/joined columns in export data?I’d appreciate any advice or insight on how to resolve this!
0 Replies