feat: Implement product and product category management with dedicated CRUD operations, services, and repositories.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user