mardi 27 septembre 2016

What is the correct condition of the if statement in php blade?

I am trying to compare the value from my database by accessing foreach loop to a given string 'allowance' and the value of $scholar->scholarship_name in database is allowance also.So, it suppose to be true but I've got the error below...

Here is the error :

syntax error, unexpected '<'

Here is the code:

@foreach($scholars as $scholar)
{!! $scholar->sponsor_name !!}
{!! $scholar->scholarship_name !!}
11-7-2014
@if (  {!! $scholar->scholarship_name !!} == 'allowance')
I have one record!
@else
I don't have any records!
@endif

@endforeach



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire