Files
exchange-2.0/app/Models/Contact.php

51 lines
972 B
PHP

<?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);
}
}