Ensure at the model level that location.id/user.id and location.parent_id/user.manager_id cannot be the same

This commit is contained in:
snipe 2020-04-21 19:51:20 -07:00
parent 5dc64ea91b
commit c02adace61
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC
2 changed files with 9 additions and 7 deletions

View file

@ -26,7 +26,8 @@ class Location extends SnipeModel
'address' => 'max:80|nullable',
'address2' => 'max:80|nullable',
'zip' => 'min:3|max:10|nullable',
'manager_id' => 'exists:users,id|nullable'
'manager_id' => 'exists:users,id|nullable',
'parent_id' => 'nullable|different:id',
);
/**

View file

@ -71,6 +71,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'password' => 'required|min:8',
'locale' => 'max:10|nullable',
'website' => 'url|nullable',
'manager_id' => 'nullable|different:id',
];
use Searchable;