Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/Models/CheckoutAcceptance.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ public function routeNotificationForMail()

return array_filter($recipients);
}

public function getCheckoutableItemTypeAttribute(): string
{
$type = $this->checkoutable_type;

return match ($type) {
Asset::class => trans('general.asset'),
LicenseSeat::class => trans('general.license'),
Accessory::class => trans('general.accessory'),
Component::class => trans('general.component'),
Consumable::class => trans('general.consumable'),
default => class_basename($type),
};
}
/**
* The resource that was is out
*
Expand Down
2 changes: 2 additions & 0 deletions resources/views/account/accept/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class="table table-striped snipe-table"
<thead>
<tr>
<th>{{ trans('general.name')}}</th>
<th>{{ trans('general.type')}}</th>
<th>{{ trans('general.serial_number')}}</th>
<th>{{ trans('table.actions')}}</th>
</tr>
Expand All @@ -40,6 +41,7 @@ class="table table-striped snipe-table"
<tr>
@if ($acceptance->checkoutable)
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->present()->name : '' }}</td>
<td>{{ $acceptance->checkoutable_item_type }}</td>
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->serial : '' }}</td>
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-default btn-sm">{{ trans('general.accept_decline') }}</a></td>
@else
Expand Down
Loading