[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

@ -24,24 +24,14 @@ class Location extends Validable
*/
protected $guarded = ['id', 'created_at', 'updated_at'];
/**
* Validation rules to apply to this model.
*
* @var array
*/
protected static $applicationRules = [
'short' => 'required',
'long' => 'required',
];
/**
* Rules ensuring that the raw data stored in the database meets expectations.
*
* @var array
*/
protected static $dataIntegrityRules = [
'short' => 'string|between:1,60|unique:locations,short',
'long' => 'string|between:1,255',
public static $validationRules = [
'short' => 'required|string|between:1,60|unique:locations,short',
'long' => 'required|string|between:1,255',
];
/**