Move meta relation into trait

This commit is contained in:
James Brooks
2019-02-18 21:56:25 +00:00
parent 827822e22e
commit 88571d7e8f
6 changed files with 60 additions and 55 deletions
+4 -11
View File
@@ -12,6 +12,7 @@
namespace CachetHQ\Cachet\Models;
use AltThree\Validator\ValidatingTrait;
use CachetHQ\Cachet\Models\Traits\HasMeta;
use CachetHQ\Cachet\Presenters\SubscriberPresenter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
@@ -28,7 +29,9 @@ use McCool\LaravelAutoPresenter\HasPresenter;
*/
class Subscriber extends Model implements HasPresenter
{
use Notifiable, ValidatingTrait;
use HasMeta,
Notifiable,
ValidatingTrait;
/**
* The attributes that should be casted to native types.
@@ -91,16 +94,6 @@ class Subscriber extends Model implements HasPresenter
});
}
/**
* Get the meta relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function meta()
{
return $this->morphMany(Meta::class, 'meta');
}
/**
* Get the subscriptions relation.
*