Moving accessor to the proper entity

parent 52cd028e
...@@ -5,7 +5,6 @@ namespace Modules\Page\Entities; ...@@ -5,7 +5,6 @@ namespace Modules\Page\Entities;
use Dimsav\Translatable\Translatable; use Dimsav\Translatable\Translatable;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Modules\Core\Traits\NamespacedEntity; use Modules\Core\Traits\NamespacedEntity;
use Modules\Page\Events\ContentIsRendering;
use Modules\Tag\Contracts\TaggableInterface; use Modules\Tag\Contracts\TaggableInterface;
use Modules\Tag\Traits\TaggableTrait; use Modules\Tag\Traits\TaggableTrait;
...@@ -48,13 +47,6 @@ class Page extends Model implements TaggableInterface ...@@ -48,13 +47,6 @@ class Page extends Model implements TaggableInterface
]; ];
protected static $entityNamespace = 'asgardcms/page'; protected static $entityNamespace = 'asgardcms/page';
public function getBodyAttribute($body)
{
event($event = new ContentIsRendering($body));
return $event->getBody();
}
public function __call($method, $parameters) public function __call($method, $parameters)
{ {
#i: Convert array to dot notation #i: Convert array to dot notation
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Modules\Page\Entities; namespace Modules\Page\Entities;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Modules\Page\Events\ContentIsRendering;
class PageTranslation extends Model class PageTranslation extends Model
{ {
...@@ -20,4 +21,11 @@ class PageTranslation extends Model ...@@ -20,4 +21,11 @@ class PageTranslation extends Model
'og_image', 'og_image',
'og_type', 'og_type',
]; ];
public function getBodyAttribute($body)
{
event($event = new ContentIsRendering($body));
return $event->getBody();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment