form validation with Parsley

This commit is contained in:
Jonathan Labreuille
2015-11-06 12:28:24 +01:00
parent cfdb886e88
commit 31305a04c0
13 changed files with 166 additions and 237 deletions

View File

@ -82,11 +82,16 @@ class Subscribers {
$errors[] = __('This form does not exist.');
}
$segments = Segment::whereIn('id', (array)$data['segments'])->findMany();
unset($data['segments']);
if(empty($segments)) {
if(empty($data['segments'])) {
$errors[] = __('You need to select a list');
} else {
$segments = Segment::whereIn('id', (array)$data['segments'])->findMany();
if(empty($segments)) {
$errors[] = __('You need to select a list');
}
}
unset($data['segments']);
$subscriber = false;
if(!empty($errors)) {