public function rules() { $rules = parent::rules(); $rules['ext1'] = 'required|catalog_in:name'; $rules['ext2'] = 'catalog_in:name'; $rules['ext3'] = 'catalog_in:name'; $rules['ext6'] = 'required|in:0,1'; $rules['ext8'] = 'in:' . implode(',', \Config::get('constants.SHIPMENT_TIME')); $rules['ext18'] = 'in:' . implode(',', \Config::get('constants.BUILD_CLASS')); $rules['ext19'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN')); $rules['ext21'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA21')); $rules['ext22'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA22')); $rules['ext23'] = 'in:' . implode(',', \Config::get('constants.BUDGET')); $rules['ext24'] = 'in:' . implode(',', \Config::get('constants.BUDGET')); $rules['ext25'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA22')); $rules['ext29'] = 'in:新聞'; $rules['ext30'] = 'in:雑誌'; $rules['ext31'] = 'in:CM'; $rules['ext32'] = 'in:サーチエンジン'; $rules['ext33'] = 'in:CD-ROM1'; $rules['ext34'] = 'in:他サイト'; $rules['ext35'] = 'in:その他'; $rules['ext40'] = 'not_taboo'; $rules['apart_reason_text'] = 'not_taboo'; $rules['apart_management'] = 'in:' . implode(',', \Config::get('constants.EXPERIENCE_MANAGEMENT')); $rules['apart_consul'] = 'in:' . implode(',', \Config::get('constants.CONSULTATION')); $rules['apart_other_maker'] = 'not_taboo'; return $rules; }
/** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = parent::rules(); // overdrive attributes $rules['tel1'] = 'haflwidth_numeric_dash|between:11,13|tel'; $rules['fax1'] = 'haflwidth_numeric_dash|between:11,13|fax'; $rules['sex'] = 'in:' . implode(',', array_values(\Config::get('constants.SEX'))); $rules['age'] = 'in:' . implode(',', array_values(\Config::get('constants.AGE'))); $rules['job'] = 'in:' . implode(',', array_values(\Config::get('constants.JOB'))); $arrInfo = $this->setRules($rules); $arrParameters = \Request::route()->parameters(); return $arrInfo[$arrParameters['slug']][$arrParameters['item']]; }
public function rules() { $rules = parent::rules(); $rules['job'] = ''; $rules['sex'] = 'in:' . implode(',', array_values(\Config::get('constants.SEX'))); $rules['age'] = 'in:' . implode(',', array_values(\Config::get('constants.AGE'))); $rules['address2'] = 'required|max:100|not_taboo'; $rules['ext8'] = 'max:200|in:' . implode(',', \Config::get('constants.BUILDING_TYPE')); // Building type name $rules['ext9'] = 'max:200|not_taboo'; $rules['ext10'] = 'digits_between:1,4|integer|min:0'; $rules['ext13'] = 'in:' . implode(',', array_values(\Config::get('constants.JOB'))); $rules['ext14'] = 'max:4000|not_taboo'; return $rules; }
/** * Get the validation rules that apply to the request. * * @author Dung Le * * @return array rules */ public function rules() { // Common rules $arrRet = parent::rules(); $segment = \Request::segments()[2]; $arrRet['ext1'] = 'catalog_in:name'; $arrRet['ext2'] = 'catalog_in:name'; $arrRet['ext3'] = 'catalog_in:name'; if ($segment == 'confirm') { $arrRet['ext1'] = 'catalog_in:key'; $arrRet['ext2'] = 'catalog_in:key'; $arrRet['ext3'] = 'catalog_in:key'; } // Get request catalog item $item = \Request::route()->parameters()['catalogItem']; switch ($item) { // extends validate form senior case 'senior': $arrRet['age'] = ''; $arrRet['sex'] = ''; $arrRet['job'] = ''; $arrRet['ext6'] = 'max:100|not_taboo'; $arrRet['ext7'] = 'max:100|not_taboo'; $arrRet['ext8'] = 'max:100|not_taboo'; $arrRet['ext9'] = 'in:' . implode(',', \Config::get('constants.SCHEDULE_OPEN_TIME')); break; case 'main_sm': case 'spsex_sm': case '20heim_sm': $this->setRulesForSP($arrRet); break; // other rules // other rules default: $arrRet['ext7'] = 'required|in:' . implode(',', \Config::get('constants.MAIL_FLG')); $arrRet['ext8'] = 'required|max:200|in:' . implode(',', \Config::get('constants.SHIPMENT_TIME')); $arrRet['ext41'] = 'required|group_in:' . implode(',', \Config::get('constants.SITUATION')); $arrRet['ext9'] = 'in:' . \Config::get('constants.FAMILY')[0]; $arrRet['ext10'] = 'in:' . \Config::get('constants.FAMILY')[1]; $arrRet['ext11'] = 'in:' . \Config::get('constants.FAMILY')[2]; $arrRet['ext12'] = 'in:' . \Config::get('constants.FAMILY')[3]; $arrRet['ext13'] = 'in:' . \Config::get('constants.FAMILY')[4]; $arrRet['ext14'] = 'in:' . \Config::get('constants.FAMILY')[5]; $arrRet['ext20'] = 'max:50|not_taboo'; $arrRet['ext15'] = 'digits_between:1,2|integer|min:0'; $arrRet['ext16'] = 'digits_between:1,2|integer|min:0'; $arrRet['ext17'] = 'digits_between:1,3|integer|min:0'; $arrRet['ext18'] = 'in:' . implode(',', \Config::get('constants.BUILD_CLASS')); $arrRet['ext19'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN')); $arrRet['ext21'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA21')); $arrRet['ext22'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA22')); $arrRet['ext23'] = 'in:' . implode(',', \Config::get('constants.BUDGET')); $arrRet['ext24'] = 'in:' . implode(',', \Config::get('constants.BUDGET')); $arrRet['ext25'] = 'in:' . implode(',', \Config::get('constants.BUILD_PLAN_AREA22')); $arrRet['ext27'] = 'digits_between:1,10|integer_extend|min:0'; $arrRet['ext28'] = 'in:' . implode(',', \Config::get('constants.REQUEST_LAYOUT')); $arrRet['ext78'] = 'in:' . \Config::get('constants.INTEREST')[0]; $arrRet['ext79'] = 'in:' . \Config::get('constants.INTEREST')[1]; $arrRet['ext80'] = 'in:' . \Config::get('constants.INTEREST')[2]; $arrRet['ext81'] = 'in:' . \Config::get('constants.INTEREST')[3]; $arrRet['ext82'] = 'in:' . \Config::get('constants.INTEREST')[4]; $arrRet['ext83'] = 'max:4000|not_taboo'; $arrRet['important'] = 'size:3|group_in:' . implode(',', \Config::get('constants.IMPORTANT')); $arrRet['ext84'] = 'in:' . implode(',', \Config::get('constants.IMPORTANT')); $arrRet['ext85'] = 'in:' . implode(',', \Config::get('constants.IMPORTANT')); $arrRet['ext86'] = 'in:' . implode(',', \Config::get('constants.IMPORTANT')); break; } return $arrRet; }