Skip to content
Advertisement

How to force the second, third… and next rows to show Delete Button in dynamic field in Laravel?

When I fetch data in from datatabse to dynamic form it shows like this. How to force the second, third… and next rows to show DELETE button. I want the first row only to show Add and the rest is delete.
enter image description here

My blade code

JavaScript

the script

JavaScript

Advertisement

Answer

You can use the $loop variable made available to you by Laravel:

JavaScript
Advertisement