*/ use HasFactory; protected $fillable = [ 'user_id', 'first_name', 'last_name', 'email', 'phone', 'secondary_phone', 'address', 'city', 'state', 'zip_code', 'notes', 'status', 'last_service_date', ]; protected $casts = [ 'last_service_date' => 'datetime', ]; /** * Get the user account associated with this customer */ public function user(): BelongsTo { return $this->belongsTo(User::class); } public function vehicles(): HasMany { return $this->hasMany(Vehicle::class); } public function serviceOrders(): HasMany { return $this->hasMany(ServiceOrder::class); } public function appointments(): HasMany { return $this->hasMany(Appointment::class); } public function getFullNameAttribute(): string { return "{$this->first_name} {$this->last_name}"; } public function getFormattedAddressAttribute(): string { return "{$this->address}, {$this->city}, {$this->state} {$this->zip_code}"; } }