File: /var/www/vhost/disk-apps/demo.sports-crowd.com/app/OrderProduct.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class OrderProduct extends Model
{
public function order()
{
return $this->belongsTo(Order::class);
}
public function products()
{
return $this->belongsTo(Product::class, 'product_id')->with('subcategoryProduct')->withTrashed();
}
public function product()
{
return $this->belongsTo(Product::class)->with('subcategoryProduct', 'productImages')->withTrashed();
}
public function orderProductAttributes()
{
return $this->hasMany(OrderProductAttributes::class)->with('attribute');
}
}