belongsToMany(Item::class) ->withPivot('price'); } public function getItemRateDetailAttribute() { return $this->items()->count() === 0 ? __( "price_list.layout." . ($this->is_increase ? 'markup' : 'markdown'), [ "percent" => $this->percentage ] ) : __("price_list.layout.manual"); } }