mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
validate json fields
This commit is contained in:
parent
24075072df
commit
7c69de5ebb
@ -37,7 +37,8 @@ class StoreClientRequest extends Request
|
||||
/* Ensure we have a client name, and that all emails are unique*/
|
||||
$rules['name'] = 'required|min:1';
|
||||
$rules['id_number'] = 'unique:clients,id_number,,id,company_id,' . auth()->user()->company()->id;
|
||||
|
||||
$rules['settings'] = 'json';
|
||||
|
||||
$contacts = request('contacts');
|
||||
|
||||
if(is_array($contacts))
|
||||
|
@ -38,6 +38,7 @@ class UpdateClientRequest extends Request
|
||||
$rules['currency_id'] = 'integer|nullable';
|
||||
$rules['country_id'] = 'integer|nullable';
|
||||
$rules['shipping_country_id'] = 'integer|nullable';
|
||||
$rules['settings'] = 'json';
|
||||
|
||||
$contacts = request('contacts');
|
||||
|
||||
|
@ -35,7 +35,7 @@ class StoreCompanyRequest extends Request
|
||||
return [
|
||||
'name' => 'required',
|
||||
'logo' => 'mimes:jpeg,jpg,png,gif|max:10000', // max 10000kb
|
||||
|
||||
'settings' => 'json',
|
||||
// 'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
||||
];
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ class UpdateCompanyRequest extends Request
|
||||
'size_id' => 'integer|nullable',
|
||||
'country_id' => 'integer|nullable',
|
||||
'work_email' => 'email|nullable',
|
||||
'settings' => 'json',
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user