Portal Domain Validation (#3098)

* fix for blank client settings

* Force all custom fields to strings

* Fixes for bulk actions

* Fix for client transformer

* Validation for portal domain -> url

* Portal Domain Validation
This commit is contained in:
David Bomba 2019-11-26 21:32:01 +11:00 committed by GitHub
parent cec7b756e8
commit 34cf93b78e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -37,7 +37,7 @@ class StoreCompanyRequest extends Request
//$rules['name'] = 'required';
$rules['company_logo'] = 'mimes:jpeg,jpg,png,gif|max:10000'; // max 10000kb
$rules['settings'] = new ValidSettingsRule();
$rules['portal_domain'] = 'url';
return $rules;
}

View File

@ -43,6 +43,8 @@ class UpdateCompanyRequest extends Request
$rules['size_id'] = 'integer|nullable';
$rules['country_id'] = 'integer|nullable';
$rules['work_email'] = 'email|nullable';
$rules['portal_domain'] = 'url';
return $rules;

View File

@ -94,8 +94,8 @@ class ClientTransformer extends EntityTransformer
'city' => $client->city ?: '',
'state' => $client->state ?: '',
'postal_code' => $client->postal_code ?: '',
'country_id' => $client->country_id ?: '',
'industry_id' => $client->industry_id ?: '',
'country_id' => (string)$client->country_id ?: '',
'industry_id' => (string)$client->industry_id ?: '',
'custom_value1' => $client->custom_value1 ?: '',
'custom_value2' => $client->custom_value2 ?: '',
'custom_value3' => $client->custom_value3 ?: '',
@ -105,7 +105,7 @@ class ClientTransformer extends EntityTransformer
'shipping_city' => $client->shipping_city ?: '',
'shipping_state' => $client->shipping_state ?: '',
'shipping_postal_code' => $client->shipping_postal_code ?: '',
'shipping_country_id' => $client->shipping_country_id ?: '',
'shipping_country_id' => (string)$client->shipping_country_id ?: '',
'settings' => $client->settings ?: new \stdClass,
'is_deleted' => (bool) $client->is_deleted,
'vat_number' => $client->vat_number ?: '',