Editing select label with pivot values
I have this form in a repeater form:
Now I am trying that the text "(absent)" appears after the username if is_absent ==true. I tried it with formatStateUsing and getOptionLabelFromRecordUsing(), but I just can't get it to work because i need the values from the relationship and the current (pivot) record. I am probably doing something stupid, but could someone point me in the right direction?
4 Replies
Does your relationship return with the pivot columns? Ie, ->withPivot() in the relationship definition on the model.
Yeah it does, the ->disabled part works perfectly also. I just don't know how to edit the label. Or to give some other visual sign that this user has a vacation or sth planned.
This is how it looks currently, what i want is also add behind the name a text (absent) or sth so that it is clear why the user is disabled.
love your table repeater btw π