Skip to content

Conversation

@Seb33300
Copy link
Contributor

@Seb33300 Seb33300 commented Jun 10, 2025

That PR adds support for array notation in exports.

Before that PR, columns using the array notation were exported as empty columns.

Related to yajra/laravel-datatables#3243

Examples:

You can declare columns like this:

Column::make('users[].name' ) // John, Jane
Column::make('users[ - ].name' ) // John - Jane

// it also supports multiple levels
Column::make('users[ - ].equipments[].name' ) // computer, mouse, keyboard - laptop, phone

@Seb33300 Seb33300 force-pushed the array-notation branch 2 times, most recently from fa1025d to 48f034d Compare June 11, 2025 02:18
@Seb33300 Seb33300 marked this pull request as draft June 11, 2025 02:26
@Seb33300
Copy link
Contributor Author

I converted as draft because I may have a more efficient way to implement this

@Seb33300 Seb33300 force-pushed the array-notation branch 2 times, most recently from ae583fb to 827f887 Compare June 11, 2025 02:47
@Seb33300 Seb33300 marked this pull request as ready for review June 11, 2025 02:52
@Seb33300
Copy link
Contributor Author

Ready for review!

Copy link
Owner

@yajra yajra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. Can you please fix the failing static analysis?

Error: Binary operation "." between mixed and ''|'.*' results in an error.
 ------ --------------------------------------------------------------------- 
  Line   Jobs/DataTableExportJob.php                                          
 ------ --------------------------------------------------------------------- 
  236    Binary operation "." between mixed and ''|'.*' results in an error.  
         🪪 binaryOp.invalid                                                  
 ------ ---------------------------------------------------------------------

@sonarqubecloud
Copy link

@Seb33300
Copy link
Contributor Author

Change looks good. Can you please fix the failing static analysis?

Fixed

@yajra yajra merged commit 7f205f9 into yajra:master Jun 11, 2025
6 of 7 checks passed
@yajra
Copy link
Owner

yajra commented Jun 11, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants