settings and page view

This commit is contained in:
merdan 2020-04-07 19:28:50 +05:00
parent 0d5d235fb1
commit 4368f5d1bb
1 changed files with 2 additions and 9 deletions

View File

@ -58,7 +58,8 @@ class Page extends Model
public function getPageLink()
{
return url($this->slug);
$slug = $this->slug?:Str::substr($this->slug,0,Str::length($this->slug)-3);
return url($slug);
}
public function getOpenButton()
@ -95,14 +96,6 @@ class Page extends Model
return $this->title;
}
public function getSlugAttribute(){
if ($this->slug != '') {
return Str::substr($this->slug,0,Str::length($this->slug)-3);
}
return $this->title;
}
/*
|--------------------------------------------------------------------------
| MUTATORS