Skip to content

Commit 3d34533

Browse files
committed
Fix syntax
1 parent 0d75024 commit 3d34533

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Models/File.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ public function scopeUnused($query)
3535

3636
public function toCmsArray()
3737
{
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+
}
3844
return [
3945
'id' => $this->id,
4046
'name' => $this->filename,
4147
'src' => FileService::getUrl($this->uuid),
4248
'original' => FileService::getUrl($this->uuid),
4349
'size' => $this->size,
4450
'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;
4752
}
4853

4954
public function getTable()

0 commit comments

Comments
 (0)