Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed May 16, 2024
2 parents d691f3b + 84a601f commit 7743b03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Models/Labels/FieldOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function getValue(Asset $asset) {

return $asset->assignedTo ? $asset->assignedTo->present()->fullName() : null;
}

// Handle Laravel's stupid Carbon datetime casting
if ($dataPath[0] === 'purchase_date') {
return $asset->purchase_date ? $asset->purchase_date->format('Y-m-d') : null;
}

return $dataPath->reduce(function ($myValue, $path) {
try { return $myValue ? $myValue->{$path} : ${$myValue}; }
Expand Down

0 comments on commit 7743b03

Please sign in to comment.