1
0
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:
David Bomba 2019-10-05 08:15:57 +10:00
parent 24075072df
commit 7c69de5ebb
4 changed files with 5 additions and 2 deletions

View File

@ -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))

View File

@ -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');

View File

@ -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',
];
}

View File

@ -40,6 +40,7 @@ class UpdateCompanyRequest extends Request
'size_id' => 'integer|nullable',
'country_id' => 'integer|nullable',
'work_email' => 'email|nullable',
'settings' => 'json',
];
}