TiagoSilvaPereira / vemto-issues

Repository to track Vemto Issues
30 stars 0 forks source link

BelongsToMany livewire component references the incorrect related model name #404

Closed xsd08tfu closed 1 year ago

xsd08tfu commented 1 year ago

Describe the bug When a BelongsToMany relationship is renamed - for example, you have a model which BelongsToMany instances of the User model, but in this case they are "Approvers" so the relationship is named as such - the Livewire Component Controller template still references the underlying model name, rather than the relationship name as declared on the model.

This can be fixed by creating a custom template and changing the relatedCrudModelPluralCamelCase variable to equal this.relationship.name within the ManyToManyDetailLivewireComponent.vemtl file.

xsd08tfu commented 1 year ago

I should add, this is in v1.2.2

TiagoSilvaPereira commented 1 year ago

@xsd08tfu thank you for reporting

TiagoSilvaPereira commented 1 year ago

Fixed on 1.3.1