Answers for "blade php if else"

PHP
2

use if in laravel blade

@if($user->status =='active')         
      <td>{{ $user->name }}</td>         
@else
      <td> Guest </td>        
@endif
Posted by: Guest on August-15-2020
7

laravel if syntax

@if (foo)
  // do something
@elseif (bar)
  // do something else
@else
  // do some other thing;
@endif
Posted by: Guest on May-11-2020
5

blade if

@if (count($records) === 1)
    I have one record!
@elseif (count($records) > 1)
    I have multiple records!
@else
    I don't have any records!
@endif
Posted by: Guest on December-19-2020

Browse Popular Code Answers by Language