Benjacho / belongs-to-many-field-nova

Belongs To Many field Laravel nova to represent many to many relationship in field.
MIT License
157 stars 81 forks source link

Issue with optionsLabel in detailed view #18

Closed chaduvulasureshreddy closed 5 years ago

chaduvulasureshreddy commented 5 years ago

With passing optionsLabel its working in add and update, because their the below code writen

this.optionsLabel = this.field.optionsLabel ? this.field.optionsLabel : 'name';

But in detailed view Means DetailField.vue file directly written {{resource.name}}

Because of the above line while i am passing optionsLabel its showing empty

Benjacho commented 5 years ago

i'll see it

Benjacho commented 5 years ago

Try this in your model, ex: optionsLabel('title') class ABC extends Model { protected $appends = [ 'name' ];

public function getNameAttribute() { return $this->title; } }

chaduvulasureshreddy commented 5 years ago

Its working, Thanks @Benjacho