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

As far as I know, the @ tags in blade just compile to <?php ... ?>

You could look into writing a blade directive though.

The syntax in 5.0 is a little gnarly with regexps, but it's been cleaned up in 5.1.

Last updated 9 years ago.
0

Or filter the array first?

@foreach( array_filter($field->options, function($option){ return $option->deleted != 1; }) as $option )

You could wrap the array_filter in a helper if that's too ugly for you:

@foreach( filter($field->options) as $option )
Last updated 9 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.