Updated variable

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-09-19 19:19:14 +01:00
parent 836893cba5
commit 5ebf0ed2b2

View file

@ -37,7 +37,7 @@ class LicensesTransformer
'notes' => Helper::parseEscapedMarkedownInline($license->notes), 'notes' => Helper::parseEscapedMarkedownInline($license->notes),
'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'), 'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'),
'seats' => (int) $license->seats, 'seats' => (int) $license->seats,
'free_seats_count' => (int) $license->free_seat_count, 'free_seats_count' => (int) $license->free_seats_count,
'min_amt' => ($license->min_amt) ? (int) ($license->min_amt) : null, 'min_amt' => ($license->min_amt) ? (int) ($license->min_amt) : null,
'license_name' => ($license->license_name) ? e($license->license_name) : null, 'license_name' => ($license->license_name) ? e($license->license_name) : null,
'license_email' => ($license->license_email) ? e($license->license_email) : null, 'license_email' => ($license->license_email) ? e($license->license_email) : null,
@ -52,7 +52,7 @@ class LicensesTransformer
'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'), 'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'),
'deleted_at' => Helper::getFormattedDateObject($license->deleted_at, 'datetime'), 'deleted_at' => Helper::getFormattedDateObject($license->deleted_at, 'datetime'),
'user_can_checkout' => (bool) ($license->free_seat_count > 0), 'user_can_checkout' => (bool) ($license->free_seats_count > 0),
]; ];
@ -61,7 +61,7 @@ class LicensesTransformer
'checkin' => Gate::allows('checkin', License::class), 'checkin' => Gate::allows('checkin', License::class),
'clone' => Gate::allows('create', License::class), 'clone' => Gate::allows('create', License::class),
'update' => Gate::allows('update', License::class), 'update' => Gate::allows('update', License::class),
'delete' => (Gate::allows('delete', License::class) && ($license->free_seat_count > 0)) ? true : false, 'delete' => (Gate::allows('delete', License::class) && ($license->free_seats_count > 0)) ? true : false,
]; ];
$array += $permissions_array; $array += $permissions_array;