first commit

This commit is contained in:
2025-12-30 15:03:19 +08:00
commit c735c36009
902 changed files with 83591 additions and 0 deletions

35
app/Models/Vendor.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Vendor extends Model
{
protected $fillable = [
'code',
'name',
'short_name',
'tax_id',
'owner',
'contact_name',
'tel',
'phone',
'email',
'address',
'remark'
];
public function products(): BelongsToMany
{
return $this->belongsToMany(Product::class, 'product_vendor')
->withPivot('last_price')
->withTimestamps();
}
public function purchaseOrders(): HasMany
{
return $this->hasMany(PurchaseOrder::class);
}
}