is_default == 1 ? '默认' : '非默认'; } /** * 获取状态文本 */ public function getEnabledTextAttribute(): string { return EnabledStatus::tryFrom($this->enabled)?->label() ?? '未知'; } /** * 获取完整地址 */ public function getFullAddressAttribute(): string { return implode('', [ $this->province, $this->city, $this->district, $this->address, ]); } /** * 关联会员 */ public function member(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Member::class, 'member_id', 'id'); } }