hasMany(ExchangeActions::class, 'order_position', 'code') ->where('exchange_actions.action_type', '=', 2); } /** * Получить информацию о действиях удаления позиции. */ public function delete_info() { return $this->hasMany(ExchangeActions::class, 'order_position', 'code') ->where('exchange_actions.action_type', '=', 5); } /** * Получить информацию о заказе. */ public function order() { return $this->hasOne(ExchangeOrders::class, 'code', 'order_code'); } }