Standardise models

This commit is contained in:
James Brooks
2018-06-16 17:00:27 +01:00
parent d97e7df68f
commit d25e626678
6 changed files with 25 additions and 25 deletions

View File

@@ -24,20 +24,6 @@ class Action extends Model
{ {
use ValidatingTrait; use ValidatingTrait;
/**
* A list of methods protected from mass assignment.
*
* @var string[]
*/
protected $guarded = ['_token', '_method'];
/**
* The relations to eager load on every query.
*
* @var string[]
*/
protected $with = ['user'];
/** /**
* The attributes that should be casted to native types. * The attributes that should be casted to native types.
* *
@@ -52,6 +38,13 @@ class Action extends Model
'description' => 'string', 'description' => 'string',
]; ];
/**
* A list of methods protected from mass assignment.
*
* @var string[]
*/
protected $guarded = ['_token', '_method'];
/** /**
* The validation rules. * The validation rules.
* *
@@ -66,6 +59,13 @@ class Action extends Model
'description' => 'required|string', 'description' => 'required|string',
]; ];
/**
* The relations to eager load on every query.
*
* @var string[]
*/
protected $with = ['user'];
/** /**
* Get the user relation. * Get the user relation.
* *

View File

@@ -135,7 +135,7 @@ class Component extends Model implements HasPresenter
} }
/** /**
* Get all of the meta relation. * Get the meta relation.
* *
* @return \Illuminate\Database\Eloquent\Relations\MorphMany * @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/ */

View File

@@ -166,7 +166,7 @@ class Metric extends Model implements HasPresenter
} }
/** /**
* Get all of the meta relation. * Get the meta relation.
* *
* @return \Illuminate\Database\Eloquent\Relations\MorphMany * @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/ */

View File

@@ -144,7 +144,7 @@ class Schedule extends Model implements HasPresenter
} }
/** /**
* Get all of the meta relation. * Get the meta relation.
* *
* @return \Illuminate\Database\Eloquent\Relations\MorphMany * @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/ */

View File

@@ -15,6 +15,13 @@ use Illuminate\Database\Eloquent\Model;
class Setting extends Model class Setting extends Model
{ {
/**
* List of attributes that have default values.
*
* @var string[]
*/
protected $attributes = ['value' => ''];
/** /**
* The attributes that should be casted to native types. * The attributes that should be casted to native types.
* *
@@ -31,11 +38,4 @@ class Setting extends Model
* @var string[] * @var string[]
*/ */
protected $fillable = ['name', 'value']; protected $fillable = ['name', 'value'];
/**
* List of attributes that have default values.
*
* @var string[]
*/
protected $attributes = ['value' => ''];
} }

View File

@@ -91,7 +91,7 @@ class Subscriber extends Model implements HasPresenter
} }
/** /**
* Get all of the meta relation. * Get the meta relation.
* *
* @return \Illuminate\Database\Eloquent\Relations\MorphMany * @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/ */