comments user
This commit is contained in:
@@ -9,6 +9,7 @@ class Comment extends Model
|
||||
protected $fillable = [
|
||||
'registration_id',
|
||||
'comment',
|
||||
'created_by',
|
||||
];
|
||||
|
||||
/*
|
||||
@@ -36,4 +37,9 @@ class Comment extends Model
|
||||
? substr($this->comment, 0, 50) . '...'
|
||||
: $this->comment;
|
||||
}
|
||||
|
||||
public function getAuthorNameAttribute()
|
||||
{
|
||||
return User::findOrFail($this->created_by)?->name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user