<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Contact
 * @package App\Models
 *
 * @property int $country_id
 * @property int $company_id
 * @property string $reference
 * @property string $phone
 * @property string $email
 * @property string $wechat_id
 */
class Contact extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'contacts';

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'deleted_at' => 'datetime',
        ];
    }

    public function company(): HasOne
    {
        return $this->hasOne(Company::class);
    }

    /**
     * @return BelongsTo
     **/
    public function country(): BelongsTo
    {
        return $this->belongsTo(Country::class);
    }
}
