Skip to content

A free open source IT asset/license management system

Update Company.php

Robert-Azelisbbb8ecfee4c6
diff --git a/app/Models/Company.php b/app/Models/Company.php
index 10b44077ae..c3a2fdae7f 100644
--- a/app/Models/Company.php
+++ b/app/Models/Company.php
@@ -24,6 +24,9 @@ final class Company extends SnipeModel
// Declare the rules for the model validation
protected $rules = [
'name' => 'required|min:1|max:255|unique:companies,name',
+ 'fax' => 'min:7|max:35|nullable',
+ 'phone' => 'min:7|max:35|nullable',
+ 'email' => 'email|max:150|nullable',
];
protected $presenter = \App\Presenters\CompanyPresenter::class;
@@ -45,7 +48,7 @@ final class Company extends SnipeModel
*
* @var array
*/
- protected $searchableAttributes = ['name', 'phone', 'fax', 'created_at', 'updated_at'];
+ protected $searchableAttributes = ['name', 'phone', 'fax', 'email', 'created_at', 'updated_at'];
/**
* The relations and their attributes that should be included when searching the model.
@@ -63,6 +66,7 @@ final class Company extends SnipeModel
'name',
'phone',
'fax',
+ 'email',
];
private static function isFullMultipleCompanySupportEnabled()