Move meta relation into trait
This commit is contained in:
+6
-11
@@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\HasMeta;
|
||||
use CachetHQ\Cachet\Models\Traits\SearchableTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use CachetHQ\Cachet\Presenters\SchedulePresenter;
|
||||
@@ -28,7 +29,11 @@ use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
*/
|
||||
class Schedule extends Model implements HasPresenter
|
||||
{
|
||||
use SearchableTrait, SoftDeletes, SortableTrait, ValidatingTrait;
|
||||
use HasMeta,
|
||||
SearchableTrait,
|
||||
SoftDeletes,
|
||||
SortableTrait,
|
||||
ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The upcoming status.
|
||||
@@ -143,16 +148,6 @@ class Schedule extends Model implements HasPresenter
|
||||
return $this->hasMany(ScheduleComponent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the meta relation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
*/
|
||||
public function meta()
|
||||
{
|
||||
return $this->morphMany(Meta::class, 'meta');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope schedules that are in progress.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user