feat: Implement product and product category management with dedicated CRUD operations, services, and repositories.

This commit is contained in:
pbao9
2026-02-06 11:05:18 +07:00
parent eef04846a8
commit 92151261b3
61 changed files with 2331 additions and 656 deletions
+6 -1
View File
@@ -5,10 +5,11 @@ namespace App\Models;
use App\Traits\HasUuid;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends Model
{
use HasFactory, HasUuid;
use HasFactory, HasUuid, SoftDeletes;
protected array $uuidColumns = ['uuid'];
protected string $slugColumn = 'name';
@@ -29,4 +30,8 @@ class Product extends Model
'sort_order',
];
public function categories()
{
return $this->belongsToMany(ProductCategories::class, 'product_product_category', 'product_id', 'product_category_id');
}
}