Added casts properties to all models, re-ordered model properties. Fixes #916

This commit is contained in:
James Brooks
2015-08-22 15:57:53 +01:00
parent 92192232ed
commit a77efc12e0
15 changed files with 182 additions and 94 deletions

View File

@@ -20,13 +20,14 @@ class IncidentTemplate extends Model
use ValidatingTrait;
/**
* The validation rules.
* The attributes that should be casted to native types.
*
* @var string[]
*/
public $rules = [
'name' => 'required',
'template' => 'required',
protected $casts = [
'id' => 'int',
'name' => 'string',
'template' => 'string',
];
/**
@@ -36,6 +37,16 @@ class IncidentTemplate extends Model
*/
protected $fillable = ['name', 'template'];
/**
* The validation rules.
*
* @var string[]
*/
public $rules = [
'name' => 'required',
'template' => 'required',
];
/**
* Overrides the models boot method.
*/