芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/yeahea.digitalhubbd.com/app/Models/Reply.php
'boolean', ]; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'reply', 'user_id', 'customer_id', 'read', 'repliable_id', 'repliable_type', ]; /** * Get all of the owning repliable models. */ public function repliable() { return $this->morphTo(); } /** * Get the user associated with the model. */ public function user() { return $this->belongsTo(User::class)->withDefault([ 'name' => trans('app.user'), ]); } /** * Get the customer associated with the model. */ public function customer() { return $this->belongsTo(Customer::class) ->withDefault([ 'name' => trans('app.guest_customer'), ]); } /** * Get the sender Name. */ public function getName() { $user = $this->customer_id ? $this->customer : $this->user; return $user->getName(); } /** * Get the sender avatar. */ public function getAvatar() { $user = $this->customer_id ? $this->customer : $this->user; return get_avatar_src($user, 'mini'); } }