belongsTo('App\Models\Ranges', 'range_id'); } public function old_slugs() { return $this->hasMany('App\Model\OldSlug', 'product_id'); } public function stats() { return $this->hasMany('App\Models\Stats', 'product_id'); } public function orders() { return $this->belongsToMany('App\Models\Orders', 'orders_products', 'product_id', 'order_id')->withPivot('quantity'); } }