public function validationDefault(validator $validator) { return $validator->requirePresence('qty')->notEmpty('qty', 'The field qty not empty !')->add('qty', ['numeric' => ['rule' => 'numeric', 'message' => 'Please enter only numbers', 'allowEmpty' => true, 'required' => false]]); }
public function validationDefault(validator $validator) { return $validator->requirePresence('name_product')->notEmpty('name_product', 'The field name product not empty !')->requirePresence('price')->notEmpty('price', 'The field price not empty'); }