🔄 در حال انجام: تست دستی Filament ⏸️ بلاک: مهاجرت ۳۹۵۰ رکورد (منتظر فایل اکسل اصلاحشده) ⏸️ بلاک: پلاگین وردپرس (بعد از تست کامل API)
38 lines
778 B
PHP
38 lines
778 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Country extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'iso_code',
|
|
'export_zone_parcel',
|
|
'export_zone_doc',
|
|
'import_zone_parcel',
|
|
'import_zone_doc',
|
|
'is_active',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function fromShipments(): HasMany
|
|
{
|
|
return $this->hasMany(Shipment::class, 'from_country_id');
|
|
}
|
|
|
|
public function toShipments(): HasMany
|
|
{
|
|
return $this->hasMany(Shipment::class, 'to_country_id');
|
|
}
|
|
}
|