Level 1
I get The solution I write here for future developer
@php
if($p->cmpApprovalSA == 0){
echo "<a href=".route('emp.data.view').">sdf</a>";
}
@endphp
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Route not working. how can I write an anchor tag, based on some condition? if the condition is true then the anchor tag will be printed with the route, I write the below code But I get an error.
In my blade template
@php
if($p->name== 0){
echo '<a href="{{ route('my.route') }}">Approve</a>';
}
@endphp
I get The solution I write here for future developer
@php
if($p->cmpApprovalSA == 0){
echo "<a href=".route('emp.data.view').">sdf</a>";
}
@endphp
Please or to participate in this conversation.