How to setup custom if statement

Posted 1 year ago by sktklaus

This returns a bool saying if I'm admin or not

  • Auth::guard('admin')->check()

This returns my role

  • Auth::guard('admin')->user()->role

Following this link https://laravel.com/docs/5.6/blade#custom-if-statements

How can I create something like @admin() To return if I'm admin and

@admin('manager', 'owner', 'administrator') to make a conditional if role == manager or owner or administrator ?

Please sign in or create an account to participate in this conversation.