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

43 lines
844 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Supplier extends Model
{
use HasFactory;
/**
* The database connection that should be used by the model.
*
* @var string
*/
protected $connection = 'vat_warehouse';
protected $table = 'supplier';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'description',
'ext_id',
'created_by',
'updated_by'
];
/**
* Get the stock entries for this supplier.
*/
public function stockEntries(): HasMany
{
return $this->hasMany(StockEntry::class, 'supplier_id');
}
}