attributes['create_time']; return $value ? date('Y-m-d H:i:s', $value) : ''; } public function toUser() { return $this->belongsTo('App\Users', 'to_user_id', 'id')->withDefault(); } public function fromUser() { return $this->belongsTo('App\Users', 'from_user_id', 'id')->withDefault(); } public function getToUserPhoneAttribute() { return $this->toUser()->value('account_number'); } public function getFromUserPhoneAttribute() { return $this->fromUser()->value('account_number'); } }