feat: add career application support for blog authors and expand blog status workflows
This commit is contained in:
@@ -82,6 +82,36 @@ class Blog extends Model
|
||||
return '/blog/' . $this->slug;
|
||||
}
|
||||
|
||||
public function getAuthorNameAttribute()
|
||||
{
|
||||
if ($this->author) {
|
||||
return $this->author->name;
|
||||
}
|
||||
if ($this->careerApplication) {
|
||||
return $this->careerApplication->name;
|
||||
}
|
||||
return __('blog.default_author');
|
||||
}
|
||||
|
||||
public function getAuthorRoleAttribute()
|
||||
{
|
||||
if ($this->author && $this->author->role) {
|
||||
return $this->author->role;
|
||||
}
|
||||
if ($this->careerApplication) {
|
||||
return 'Stajyer Yazılım Geliştirici';
|
||||
}
|
||||
return 'Trunçgil Teknoloji Editörü';
|
||||
}
|
||||
|
||||
public function getAuthorAvatarUrlAttribute()
|
||||
{
|
||||
if ($this->author && $this->author->avatar) {
|
||||
return asset('storage/' . $this->author->avatar);
|
||||
}
|
||||
return asset('assets/img/avatars/u5.webp');
|
||||
}
|
||||
|
||||
public function getFeaturedImageUrlAttribute()
|
||||
{
|
||||
if ($this->featured_image) {
|
||||
|
||||
Reference in New Issue
Block a user