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

@@ -21,21 +21,16 @@ class Subscriber extends Model implements HasPresenter
use ValidatingTrait;
/**
* The validation rules.
* The attributes that should be casted to native types.
*
* @var string[]
*/
public $rules = [
'email' => 'required|email',
protected $casts = [
'id' => 'int',
'email' => 'string',
'verify_code' => 'string',
];
/**
* The fillable properties.
*
* @var string[]
*/
protected $fillable = ['email'];
/**
* The attributes that should be mutated to dates.
*
@@ -44,13 +39,19 @@ class Subscriber extends Model implements HasPresenter
protected $dates = ['verified_at'];
/**
* The attributes that should be casted to native types.
* The fillable properties.
*
* @var string[]
*/
protected $casts = [
'email' => 'string',
'verify_code' => 'string',
protected $fillable = ['email'];
/**
* The validation rules.
*
* @var string[]
*/
public $rules = [
'email' => 'required|email',
];
/**