I am trying to produce something like
id="checkout-button-{someid}"
For instance
id="checkout-button-jjn5jghj5"
I thought this would be done through unescaped strings doing this
id={!! "checkout-button-$item->id" !!}
But this is not producing the variable in the string.
What is proper way to do this in blade views?
Blade is going to
{{
}}
, and then {{ ... }}
stringIn your case, the only thing you need Blade for is getting the id
. So your statement should look like this:
id="checkout-button-{{ $item->id }}"