Laravel backpack supports multi roles in blade template

文章目录

    As document, use hasanyrole(Role::all()) to support multi roles in blade template.

    https://github.com/Laravel-Backpack/PermissionManager

    @hasanyrole(Role::all())
        I have one or more of these roles!
    @else
        I have none of these roles...
    @endhasanyrole
    

    Error shows:

    [2019-06-24 14:29:36] production.ERROR: Class 'Role' not found (View: vendor/backpack/base/inc/sidebar.blade.php) 
    

    Solution:

    @hasanyrole(['admin', 'role1', 'role2'])