File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
src/Services/Data/Computors Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 3
3
namespace LaravelEnso \Tables \Services \Data \Computors ;
4
4
5
5
use Carbon \Carbon ;
6
+ use Illuminate \Support \Arr ;
6
7
use Illuminate \Support \Facades \Config ;
7
8
use LaravelEnso \Helpers \Services \Obj ;
8
9
use LaravelEnso \Tables \Contracts \ComputesArrayColumns ;
@@ -21,10 +22,11 @@ public static function columns($columns): void
21
22
public static function handle (array $ row ): array
22
23
{
23
24
foreach (self ::$ columns as $ column ) {
24
- if ($ row [$ column ->get ('name ' )] !== null ) {
25
- $ row [$ column ->get ('name ' )] = Carbon::parse ($ row [$ column ->get ('name ' )])
25
+ $ rowValue = Arr::get ($ row , $ column ->get ('name ' ));
26
+ if ($ rowValue !== null ) {
27
+ Arr::set ($ row , $ column ->get ('name ' ), Carbon::parse ($ rowValue )
26
28
->setTimezone (Config::get ('app.timezone ' ))
27
- ->format (self ::format ($ column ));
29
+ ->format (self ::format ($ column ))) ;
28
30
}
29
31
}
30
32
Original file line number Diff line number Diff line change 2
2
3
3
namespace LaravelEnso \Tables \Services \Data \Computors ;
4
4
5
+ use Illuminate \Support \Arr ;
5
6
use Illuminate \Support \Facades \App ;
6
7
use LaravelEnso \Helpers \Services \Obj ;
7
8
use LaravelEnso \Tables \Contracts \ComputesArrayColumns ;
@@ -22,10 +23,10 @@ public static function columns($columns): void
22
23
public static function handle (array $ row ): array
23
24
{
24
25
foreach (self ::$ columns as $ column ) {
25
- $ row[ $ column ->get ('name ' )] = self ::format (
26
- $ row[ $ column ->get ('name ' )] ,
26
+ Arr:: set ( $ row, $ column ->get ('name ' ), self ::format (
27
+ Arr:: get ( $ row, $ column ->get ('name ' )) ,
27
28
$ column ->get ('number ' )->get ('precision ' )
28
- );
29
+ )) ;
29
30
}
30
31
31
32
return $ row ;
You can’t perform that action at this time.
0 commit comments