I'm new to Laravel blade and trying to nest an if statement inside a foreach loop. I want to show a different link depending on whether a field in my table equals Submitted. I have written the following code in my view:
@foreach($plans as $plan)
<tr>
<td> {{$plan->id}}</td>
{{-- If the Plan Submission has been submitted, the link should bring the user to the Show function which is view only. Cannot have user editing Plan Submission after it has been submitted. --}}
@if ({{$plan->status}}=='Submitted')
<td><a href="/basicinfo/{{$plan->id}}/show">Click Here</a></td>
@else
<td><a href="/basicinfo/{{$plan->id}}/edit">Click Here</a></td>
@endif
I am getting this error: syntax error
unexpected '<'