Update Company.php

This commit is contained in:
Robert-Azelis 2023-08-13 17:21:55 +02:00 committed by GitHub
parent 8988a5dfc3
commit bbb8ecfee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,9 @@ final class Company extends SnipeModel
// Declare the rules for the model validation // Declare the rules for the model validation
protected $rules = [ protected $rules = [
'name' => 'required|min:1|max:255|unique:companies,name', '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; protected $presenter = \App\Presenters\CompanyPresenter::class;
@ -45,7 +48,7 @@ final class Company extends SnipeModel
* *
* @var array * @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. * The relations and their attributes that should be included when searching the model.
@ -63,6 +66,7 @@ final class Company extends SnipeModel
'name', 'name',
'phone', 'phone',
'fax', 'fax',
'email',
]; ];
private static function isFullMultipleCompanySupportEnabled() private static function isFullMultipleCompanySupportEnabled()