belongsToMany('App\Models\Product', 'orders_products', 'order_id', 'product_id')->withPivot('quantity'); } public function status() { return $this->belongsTo('App\Models\OrdersStatus', 'status_id'); } public function user() { return $this->belongsTo('App\Models\User', 'user_id'); } }