<?php

namespace App\Models\Address;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
 * App\Models\Address\Address
 *
 * @property int $id
 * @property int|null $customer_id
 * @property int|null $lead_id
 * @property string|null $address_line_1
 * @property string|null $address_line_2
 * @property string|null $city_id
 * @property string|null $state_id
 * @property string|null $country_id
 * @property string|null $zip
 * @property string|null $phone_1
 * @property string|null $phone_2
 * @property string|null $email_1
 * @property string|null $email_2
 * @property string $is_billing_address
 * @property string $is_shipping_address
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Address\AddressEmail[] $addressEmails
 * @property-read int|null $address_emails_count
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Address\AddressPhone[] $addressPhones
 * @property-read int|null $address_phones_count
 * @property-read \App\Models\Contact\Contact $contact
 * @property-read \App\Models\Leads\Lead|null $lead
 * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
 * @property-read int|null $notifications_count
 * @method static \Database\Factories\Address\AddressFactory factory(...$parameters)
 * @method static \Illuminate\Database\Eloquent\Builder|Address newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Address newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Address query()
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereAddressLine1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereAddressLine2($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereCityId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereCountryId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereCustomerId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereEmail1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereEmail2($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereIsBillingAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereIsShippingAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereLeadId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address wherePhone1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address wherePhone2($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereStateId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Address whereZip($value)
 * @mixin \Eloquent
 */
class Address extends Model
{
    use HasFactory, Notifiable;
    protected $guarded = [];

    public function contact(){
        return $this->belongsTo('App\Models\Contact\Contact');
    }

    public function lead(){
        return $this->belongsTo('App\Models\Leads\Lead');
    }

    public function addressPhones(){
        return $this->hasMany('App\Models\Address\AddressPhone');
    }

    public function addressEmails(){
        return $this->hasMany('App\Models\Address\AddressEmail');
    }
}
