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'])
    

    关于作者 🌱

    我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊,或者关注我的个人公众号“大象工具”, 查看更多联系方式