'integer', 'city_id' => 'integer', 'address' => 'string', 'home' => 'string', 'landmark' => 'string', ]; protected static $logName = 'addresses'; protected static $recordEvents = ['deleted', 'updated']; protected static $logOnlyDirty = true; protected static $logAttributes = [ 'user_id', 'city_id', 'address', 'home', 'landmark' ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function city(): BelongsTo { return $this->belongsTo(City::class, 'city_id', 'id'); } public function getCity(): string { return (string) $this->city->getName(); } public function getFullAddress(): string|null { return $this->getCity() . ', ' . $this->address . ', ' . $this->home . ', ' . $this->landmark; } public function getShortAddress(): string|null { return $this->getCity() . ', ' . $this->address; } public function getHomeAddress(): string|null { return $this->home . ', ' . $this->landmark; } public function getAddress(): string|null { return $this->address; } public function getHome(): string|null { return $this->home; } public function getLandmark(): string|null { return $this->landmark; } }