feat: Implement comprehensive product management, including categories, pricing, and integration into the order system.

This commit is contained in:
pbao9
2026-02-12 14:29:29 +07:00
parent 3b1beef66e
commit f3a679d7f3
25 changed files with 577 additions and 692 deletions
@@ -40,8 +40,8 @@ class ProductController extends Controller
{
$step = $request->get('step') ?? 1;
$title = 'Add new product';
// Fetch Product Categories instead of generic groups
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->get();
// Fetch Product Categories (Roots only, children via relation)
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->whereNull('parent_id')->get();
$type = null;
// Fetch OS versions with their group for the OS selector component
@@ -91,7 +91,7 @@ class ProductController extends Controller
$product->load(['pricings', 'osVersions', 'category']);
$title = 'Edit product: ' . $product->name;
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->get();
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->whereNull('parent_id')->get();
$type = null;
// Fetch OS versions for select