Files
exchange-2.0/app/Models/Country.php
T

44 lines
821 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Country
* @package App\Models
*
* @property string $name
* @property string $short_code
* @property string $phone_code
*/
class Country extends AbstractModel
{
use SoftDeletes;
protected $table = 'countries';
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'deleted_at' => 'datetime',
];
}
protected $fillable = ['name', 'short_code', 'phone_code'];
/**
* @return HasMany
*/
public function currencies(): HasMany
{
return $this->HasMany(Currency::class, 'country_id', 'id');
}
}