Home > OS >  Problems properly closing {{}} on a blade
Problems properly closing {{}} on a blade

Time:12-21

I'm having trouble getting the record id encrypted in the url. The error is Unclosed '(' does not match '}'.

action="{{ url("delete/$hxh->{{Crypt::encrypt('id')}}") }}"
href="{{ url("update/$hxh->{{Crypt::encrypt('id')}}") }}"

How do I correctly resolve this in blade.

CodePudding user response:

The syntax highlighting in your question shows the issue.
You need to escape your quotes:

action="{{ url(\"delete/$hxh->{{Crypt::encrypt('id')}}\") }}"
ref="{{ url(\"update/$hxh->{{Crypt::encrypt('id')}}\") }}"

CodePudding user response:

action="{{ url("delete/".encrypt($hxh->id)) }}"
href="{{ url("update/".encrypt($hxh->id)) }}"
  • Related