Skip to content

A free open source IT asset/license management system

FIX: #10898 (invalid consumable date time info in user view)

Achmad Fienan Rahardianto231a34ace397
diff --git a/app/Models/User.php b/app/Models/User.php
index 8f06eae6a8..7b0e3c903e 100755
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -308,7 +308,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/
public function consumables()
{
- return $this->belongsToMany(\App\Models\Consumable::class, 'consumables_users', 'assigned_to', 'consumable_id')->withPivot('id')->withTrashed();
+ return $this->belongsToMany(\App\Models\Consumable::class, 'consumables_users', 'assigned_to', 'consumable_id')->withPivot('id','created_at')->withTrashed();
}
/**
diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php
index 20d62247d2..3091858ba3 100755
--- a/resources/views/users/view.blade.php
+++ b/resources/views/users/view.blade.php
@@ -738,7 +738,7 @@
<td>
{!! Helper::formatCurrencyOutput($consumable->purchase_cost) !!}
</td>
- <td>{{ $consumable->created_at }}</td>
+ <td>{{ $consumable->pivot->created_at }}</td>
</tr>
@endforeach
</tbody>