Init: Hoan thanh kien truc V3 va Filament UI

This commit is contained in:
2026-04-18 02:07:30 +00:00
commit 761b34916b
141 changed files with 15917 additions and 0 deletions

26
app/Models/Contract.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Contract extends Model
{
use HasUuids, HasFactory;
protected $guarded = [];
// 1 Hợp đồng thuộc về 1 Sản phẩm
public function product()
{
return $this->belongsTo(Product::class);
}
// 1 Hợp đồng có thể có nhiều Khách hàng (Đồng sở hữu)
public function customers()
{
return $this->belongsToMany(Customer::class, 'contract_customers')->withPivot('role', 'transfer_order')->withTimestamps();
}
}