belongsToMany(Product::class); } public static function getTitlesOfTypes() { return [self::TYPE_TO => 'Поступление', self::TYPE_FROM => 'Расход']; } public function documentProducts(): HasMany { return $this->hasMany(DocumentProduct::class); } }