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

It is transformed to normal ifs, so your example result in

<?php if ($user->role == 'writer') {?>
<?php if ($view == 'book') {?>
  <?php echo $one; ?>
<?php } else {?>
  <?php echo $two; ?>
<?php } ?>

But you can combine multiple checks in the same if. So if I correctly understand what you want:

@if ($user->role == 'writer' && $view == 'book')
  {{ $one }}
@else
  {{ $two }}
@endif
Last updated 5 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Edgars narkoze Joined 27 Feb 2019

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.