[L6] Add support for custom model validation logic

This commit is contained in:
Dane Everitt 2019-09-04 22:19:57 -07:00
parent 5b4a65a60c
commit c586157dc4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
19 changed files with 226 additions and 330 deletions

View file

@ -45,24 +45,15 @@ class EggVariable extends Validable
/**
* @var array
*/
protected static $applicationRules = [
'name' => 'required',
'env_variable' => 'required',
'rules' => 'required',
];
/**
* @var array
*/
protected static $dataIntegrityRules = [
public static $validationRules = [
'egg_id' => 'exists:eggs,id',
'name' => 'string|between:1,255',
'name' => 'required|string|between:1,255',
'description' => 'string',
'env_variable' => 'regex:/^[\w]{1,255}$/|notIn:' . self::RESERVED_ENV_NAMES,
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . self::RESERVED_ENV_NAMES,
'default_value' => 'string',
'user_viewable' => 'boolean',
'user_editable' => 'boolean',
'rules' => 'string',
'rules' => 'required|string',
];
/**