Skip to content

A free open source IT asset/license management system

Validate checkout_to_type on asset checkout

snipeea2f7617dfd7
diff --git a/app/Http/Requests/AssetCheckoutRequest.php b/app/Http/Requests/AssetCheckoutRequest.php
index d0991b308d..66b861525e 100644
--- a/app/Http/Requests/AssetCheckoutRequest.php
+++ b/app/Http/Requests/AssetCheckoutRequest.php
@@ -24,9 +24,10 @@ class AssetCheckoutRequest extends Request
public function rules()
{
$rules = [
- "assigned_user" => 'required_without_all:assigned_asset,assigned_location',
- "assigned_asset" => 'required_without_all:assigned_user,assigned_location|different:'.$this->id,
- "assigned_location" => 'required_without_all:assigned_user,assigned_asset',
+ "assigned_user" => 'required_without_all:assigned_asset,assigned_location',
+ "assigned_asset" => 'required_without_all:assigned_user,assigned_location|different:'.$this->id,
+ "assigned_location" => 'required_without_all:assigned_user,assigned_asset',
+ "checkout_to_type" => 'required|in:asset,location,user'
];