vat_wms/app/Models/OriginCountry.php
2025-05-14 12:46:16 +02:00

61 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class OriginCountry extends Model
{
use HasFactory;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'country_of_origin';
protected $connection = 'vat_warehouse';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'code',
'created_by',
'updated_by',
];
/**
* The attributes that should be cast to native types.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
'created_by' => 'integer',
'updated_by' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/**
* Get the user who created this record.
*/
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
/**
* Get the user who last updated this record.
*/
public function updater()
{
return $this->belongsTo(User::class, 'updated_by');
}
}