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

31
app/Models/Product.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasUuids, HasFactory;
protected $guarded = [];
// Ép kiểu JSON để Filament có thể đọc/ghi dữ liệu linh hoạt (tầng, hướng, mặt tiền...)
protected $casts = [
'custom_data' => 'array',
];
// Khai báo mối quan hệ V3: 1 Sản phẩm thuộc về 1 Dự án
public function project()
{
return $this->belongsTo(Project::class);
}
// Đón đầu cho các bước tiếp theo: 1 Sản phẩm có nhiều Hợp đồng
public function contracts()
{
return $this->hasMany(Contract::class);
}
}