mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Added location to seats transformer
This commit is contained in:
parent
af7b7664c5
commit
2bbb6001a8
|
@ -23,7 +23,8 @@ class LicenseSeatsTransformer
|
|||
public function transformLicenseSeat (LicenseSeat $seat, $seat_count)
|
||||
{
|
||||
$array = [
|
||||
'id' => (int) $seat->license->id,
|
||||
'id' => (int) $seat->id,
|
||||
'license_id' => (int) $seat->license->id,
|
||||
'name' => 'Seat '.$seat_count,
|
||||
'assigned_user' => ($seat->user) ? [
|
||||
'id' => (int) $seat->user->id,
|
||||
|
@ -33,6 +34,10 @@ class LicenseSeatsTransformer
|
|||
'id' => (int) $seat->asset->id,
|
||||
'name'=> e($seat->asset->present()->fullName)
|
||||
] : null,
|
||||
'location' => ($seat->location()) ? [
|
||||
'id' => (int) $seat->location()->id,
|
||||
'name'=> e($seat->location()->name)
|
||||
] : null,
|
||||
'reassignable' => (bool) $seat->license->reassignable,
|
||||
'user_can_checkout' => (($seat->assigned_to=='') && ($seat->asset_id=='')) ? true : false,
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue