File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 12
12
use Illuminate \Http \JsonResponse ;
13
13
use Illuminate \Http \Resources \Json \AnonymousResourceCollection ;
14
14
use Illuminate \Http \Response ;
15
+ use Illuminate \Support \Arr ;
15
16
use Illuminate \Support \Collection ;
16
17
use Illuminate \Support \LazyCollection ;
17
18
use Maatwebsite \Excel \ExcelServiceProvider ;
@@ -679,11 +680,18 @@ public function fastExcelCallback(): Closure
679
680
->reject (fn (Column $ column ) => $ column ->exportable === false )
680
681
->each (function (Column $ column ) use (&$ mapped , $ row ) {
681
682
$ callback = $ column ->exportRender ?? null ;
683
+ $ key = $ column ->data ;
684
+
685
+ if (is_array ($ key )) {
686
+ $ data = Arr::get ($ row , $ key ['_ ' ]);
687
+ } else {
688
+ $ data = Arr::get ($ row , $ key );
689
+ }
682
690
683
691
if (is_callable ($ callback )) {
684
- $ mapped [$ column ->title ] = $ callback ($ row , $ row [ $ column -> data ] );
692
+ $ mapped [$ column ->title ] = $ callback ($ row , $ data );
685
693
} else {
686
- $ mapped [$ column ->title ] = $ row [ $ column -> data ] ;
694
+ $ mapped [$ column ->title ] = $ data ;
687
695
}
688
696
});
689
697
You can’t perform that action at this time.
0 commit comments