Adding helper methods to fetch urls on Page

parent cd507c4c
......@@ -47,6 +47,20 @@ class Page extends Model implements TaggableInterface
];
protected static $entityNamespace = 'asgardcms/page';
public function getCanonicalUrl() : string
{
if ($this->is_home === true) {
return url('/');
}
return route('page', $this->slug);
}
public function getEditUrl() : string
{
return route('admin.page.page.edit', $this->id);
}
public function __call($method, $parameters)
{
#i: Convert array to dot notation
......
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