[L6] Add support for custom model validation logic
This commit is contained in:
parent
5b4a65a60c
commit
c586157dc4
19 changed files with 226 additions and 330 deletions
|
@ -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',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue