Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years ago.
0

I'm kind of new here, and not professional. Still, i look for solutions for me, and when i find i can, i help!

Got a little confused, maybe try to remember

foreach($entity as $a=> $b)
{
echo $a; // = "<fieldmame>" (name)
echo $b; //  = <value> (john)
}

foreach($entity as $a)
echo $a; // = <value> (john);

then, doing blade you can also decide with if cycle

@foreach($entity as $key => $value)
       
     @if ($something)
    <p>Something is true!  {{ $variable }}   </p>
     @else
    <p>Something is false!</p> 
      @endif

@endforeach
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.