HEX
Server: Apache
System: Linux c27.eelserver.com 5.14.0-503.22.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 24 03:55:12 EST 2025 x86_64
User: promosig (1506)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/promosig/testing-development.com/app/Models/Product.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use HasFactory;
    public function categories(){
        return $this->belongsToMany(Category::class,'product_category');
    }
    public function subcategory()
{
    return $this->belongsTo(Subcategory::class);
}
    public function brands(){
        return $this->belongsToMany(Brand::class,'product_brands');
    }
    public function images(){
        return $this->hasMany(ProductImage::class);
    }
    public function orders(){
        return $this->hasMany(OrderItem::class,'product_id','id');
    }
}