<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserAddress extends Model
{
    protected $fillable = [
        'user_id', 'type', 'contact_name', 'contact_phone', 
        'country_id', 'state_id', 'city_id', 
        'zip_code', 'address_line_1', 'address_line_2', 'is_default'
    ];

    protected $casts = [
        'is_default' => 'boolean',
    ];

    public function country() { return $this->belongsTo(Country::class); }
    public function state() { return $this->belongsTo(State::class); }
    public function city() { return $this->belongsTo(City::class); }
}