File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,20 @@ public function scopeUnused($query)
35
35
36
36
public function toCmsArray ()
37
37
{
38
+ $ uploadedDate = [];
39
+ if (config ('twill.file-library.show_uploaded_date ' )) {
40
+ $ uploadedDate = [
41
+ 'uploadedDate ' => $ this ->created_at ->format (config ("twill.file-library.format_uploaded_date " , "d/m/Y H:i " ))
42
+ ];
43
+ }
38
44
return [
39
45
'id ' => $ this ->id ,
40
46
'name ' => $ this ->filename ,
41
47
'src ' => FileService::getUrl ($ this ->uuid ),
42
48
'original ' => FileService::getUrl ($ this ->uuid ),
43
49
'size ' => $ this ->size ,
44
50
'filesizeInMb ' => number_format ($ this ->attributes ['size ' ] / 1048576 , 2 ),
45
- ] + ((config ('twill.file-library.show_uploaded_date ' )
46
- ? ['uploadedDate ' => $ this ->created_at ->format (config ("twill.file-library.format_uploaded_date " , "d/m/Y H:i " ))]);
51
+ ] + $ uploadedDate ;
47
52
}
48
53
49
54
public function getTable ()
You can’t perform that action at this time.
0 commit comments