Maybe you could try to use a pure javascript implementation in your view using a prepared json string from your controller. Something like :
This way you could easily extract your javascript code into a plugin and reduce again the code in your view. Check that, I didn't test it but I'm sure you'll get the id.
You can also cut your code into partials.
Thanks, I've used your first code sample to come up with the following:
Controller: http://laravel.io/bin/6edXD View: http://laravel.io/bin/29ldE
Much cleaner!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community