From d25e6266781e07975f0b0235a0dd94ae989d55b7 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Sat, 16 Jun 2018 17:00:27 +0100 Subject: [PATCH] Standardise models --- app/Models/Action.php | 28 ++++++++++++++-------------- app/Models/Component.php | 2 +- app/Models/Metric.php | 2 +- app/Models/Schedule.php | 2 +- app/Models/Setting.php | 14 +++++++------- app/Models/Subscriber.php | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/Models/Action.php b/app/Models/Action.php index 5ff0a310..be9cfcc1 100644 --- a/app/Models/Action.php +++ b/app/Models/Action.php @@ -24,20 +24,6 @@ class Action extends Model { 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. * @@ -52,6 +38,13 @@ class Action extends Model 'description' => 'string', ]; + /** + * A list of methods protected from mass assignment. + * + * @var string[] + */ + protected $guarded = ['_token', '_method']; + /** * The validation rules. * @@ -66,6 +59,13 @@ class Action extends Model 'description' => 'required|string', ]; + /** + * The relations to eager load on every query. + * + * @var string[] + */ + protected $with = ['user']; + /** * Get the user relation. * diff --git a/app/Models/Component.php b/app/Models/Component.php index d1cb1436..49bfa875 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -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 */ diff --git a/app/Models/Metric.php b/app/Models/Metric.php index a126ab37..e1b6641f 100644 --- a/app/Models/Metric.php +++ b/app/Models/Metric.php @@ -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 */ diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 42442363..e119ff15 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -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 */ diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 0ea02148..54ea2b77 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -15,6 +15,13 @@ use Illuminate\Database\Eloquent\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. * @@ -31,11 +38,4 @@ class Setting extends Model * @var string[] */ protected $fillable = ['name', 'value']; - - /** - * List of attributes that have default values. - * - * @var string[] - */ - protected $attributes = ['value' => '']; } diff --git a/app/Models/Subscriber.php b/app/Models/Subscriber.php index 964a73eb..7b0fb2ef 100644 --- a/app/Models/Subscriber.php +++ b/app/Models/Subscriber.php @@ -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 */