<?php

namespace App\Trait;

use App\Models\Address;

trait HasAddresses {
    public function addresses() {
        return $this->morphMany(Address::class, 'owner');
    }

    public function currentAddress() {
        return $this->morphOne(Address::class, 'owner')->where('is_current', true);
    }
}