I need to check the name in an array of names, but I'm having trouble passing the array instead of the collection to the in_array () method.
My ice code looks something like this.
@foreach($ecn->areas as $area)
{{ $area->area }}:<br>
<ul>
@foreach($area->people as $person)
@if(in_array($person, $ecn->signatures->name ))
<li><del>{{ $person }}</del></li>
@else
<li>{{ $person }}</li>
@endif
@endforeach
</ul>
@endforeach
I know that my problem is how I try to access the list of signatures.
@if(in_array($person, $ecn->signatures->name ))
I can access them in another part of the page by doing this
@foreach($ecn->signatures as $signature)
{{ $signature->name }}<br>
@endforeach
and everything is in order.
How can I access and pass the list of signatures as an array in this scenario?
CFree source
share