Skip to content
Advertisement

duplicate value on select2 tag on laravel blade template

I found a bug when i try to displayed data on select2 tag. I got duplicate data and I want to know how to fixed it. Im using laravel 7 and here’s my code

This is my controller code:

JavaScript

}

This is my blade template :

JavaScript

And this is the result : enter image description here

Anyone can help me ? Thank you

Advertisement

Answer

JavaScript
JavaScript

I think this should do.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement