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

47 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Manufacturer extends Model
{
protected $table = 'manufacturer';
protected $connection = 'vat_warehouse';
// Enable Laravels created_at / updated_at
public $timestamps = true;
/**
* The attributes that are mass assignable.
* (We guard out `id` and the computed `_name` column.)
*/
protected $fillable = [
'name',
'description',
'ext_id',
'created_by',
'updated_by',
];
/**
* The attributes that should be cast to native types.
*/
protected $casts = [
'id' => 'integer',
'ext_id' => 'integer',
'created_by' => 'integer',
'updated_by' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
// _name is a stored generated column, so youll get it automatically
'_name' => 'string',
];
public function physicalItems()
{
return $this->hasMany(PhysicalItem::class, 'manufacturer_id');
}
}