Add additional information to acceptance notifications for assets, accessories, and consumables

This commit is contained in:
Marcus Moore 2023-05-03 17:04:01 -07:00
parent 9efe13bb5e
commit 96c6d8896f
No known key found for this signature in database

View file

@ -248,10 +248,14 @@ class AcceptanceController extends Controller
// This is the most horriblest // This is the most horriblest
switch($acceptance->checkoutable_type){ switch($acceptance->checkoutable_type){
case 'App\Models\Asset': case 'App\Models\Asset':
$asset_model = AssetModel::find($item->model_id);
$display_model = $asset_model->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
case 'App\Models\Accessory': case 'App\Models\Accessory':
$accessory = Accessory::find($item->id);
$display_model = $accessory->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
@ -264,6 +268,8 @@ class AcceptanceController extends Controller
break; break;
case 'App\Models\Consumable': case 'App\Models\Consumable':
$consumable = Consumable::find($item->id);
$display_model = $consumable->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
} }