Skip to content

A free open source IT asset/license management system

Updated undeleted validation

snipe16fe53928c27
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 8c4cd17f40..9354833f7e 100755
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -26,7 +26,7 @@ class Category extends Model
*/
public $rules = array(
'user_id' => 'numeric',
- 'name' => 'required|min:1|max:255|unique_undeleted:categories',
+ 'name' => 'required|min:1|max:255|unique_undeleted',
'category_type' => 'required',
);
diff --git a/app/Models/Company.php b/app/Models/Company.php
index ab3aad5dcf..fc7e47303b 100644
--- a/app/Models/Company.php
+++ b/app/Models/Company.php
@@ -18,7 +18,7 @@ final class Company extends Model
// Declare the rules for the model validation
protected $rules = [
- 'name' => 'required|min:1|max:255|unique_undeleted:companies'
+ 'name' => 'required|min:1|max:255|unique_undeleted'
];
diff --git a/app/Models/Location.php b/app/Models/Location.php
index 192ad5a1be..2f7dc9d1e6 100755
--- a/app/Models/Location.php
+++ b/app/Models/Location.php
@@ -14,7 +14,7 @@ class Location extends Model
protected $dates = ['deleted_at'];
protected $table = 'locations';
protected $rules = array(
- 'name' => 'required|min:3|max:255|unique_undeleted:locations',
+ 'name' => 'required|min:3|max:255|unique_undeleted',
'city' => 'min:3|max:255',
'state' => 'min:2|max:32',
'country' => 'min:2|max:2|max:2',
diff --git a/app/Models/Statuslabel.php b/app/Models/Statuslabel.php
index 5f10aa5a09..e710608ee1 100755
--- a/app/Models/Statuslabel.php
+++ b/app/Models/Statuslabel.php
@@ -18,7 +18,7 @@ class Statuslabel extends Model
protected $rules = array(
- 'name' => 'required|string|unique_undeleted:status_labels',
+ 'name' => 'required|string|unique_undeleted',
'notes' => 'string',
'deployable' => 'required',
'pending' => 'required',
diff --git a/app/Models/Supplier.php b/app/Models/Supplier.php
index fc37aa3ffc..5a3878196f 100755
--- a/app/Models/Supplier.php
+++ b/app/Models/Supplier.php
@@ -12,7 +12,7 @@ class Supplier extends Model
protected $dates = ['deleted_at'];
protected $rules = array(
- 'name' => 'required|min:3|max:255|unique_undeleted:suppliers',
+ 'name' => 'required|min:3|max:255|unique_undeleted',
'address' => 'min:3|max:255',
'address2' => 'min:2|max:255',
'city' => 'min:3|max:255',
diff --git a/app/Models/User.php b/app/Models/User.php
index d678b4e51a..282447c8b2 100755
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -33,7 +33,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $rules = [
'first_name' => 'required|string|min:1',
- 'username' => 'required|string|min:2|unique_undeleted:users',
+ 'username' => 'required|string|min:2|unique_undeleted',
'email' => 'email',
'password' => 'required|min:6',
];