search

Home  >  Q&A  >  body text

How to write Laravel's blade template if expression with two conditions?

How to write Laravel's blade template if expression with two conditions?

This is a condition:

@if (Auth::check())
    
@endif

Question:
If there are two conditions, "and" and "or", how should I write them?

//“或”这样写可以吗?“与”呢?
@if (Auth::check()|Entrust::hasRole('seller'))
    
@endif
天蓬老师天蓬老师2756 days ago552

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 16:52:54

    @if (Auth::guest()|| Entrust::hasRole('seller'))
    
    @if (Auth::guest()&& Entrust::hasRole('seller'))
    

    This is the same as the normal AND or in PHP

    reply
    0
  • Cancelreply