feat: add FeaturedGroup and FeaturedProduct models with migrations for database structure

This commit is contained in:
2026-07-14 13:30:07 -03:00
parent 3afef63fc7
commit b4b888adef
4 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Domains\Product\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class FeaturedGroup extends Model
{
protected $fillable = [
'tenant_codigo',
'group_name',
'product_layout',
];
public function featuredProducts(): HasMany
{
return $this->hasMany(FeaturedProduct::class);
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Domains\Product\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class FeaturedProduct extends Model
{
protected $fillable = [
'featured_group_id',
'product_id',
'order',
];
public function featuredGroup(): BelongsTo
{
return $this->belongsTo(FeaturedGroup::class);
}
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}