Support the ongoing development of Laravel.io →
posted 8 years ago
Blade
Last updated 1 year 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 8 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 8 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.