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
+32
View File
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Models\Traits;
use CachetHQ\Cachet\Models\Meta;
/**
* This is the has meta trait.
*
* @author James Brooks <james@alt-three.com>
*/
trait HasMeta
{
/**
* Get the meta relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function meta()
{
return $this->morphMany(Meta::class, 'meta');
}
}