Standardise models
This commit is contained in:
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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' => ''];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user