Laravel backpack supports multi roles in blade template

更新日期: 2019-06-24 阅读次数: 916 字数: 50 分类: backpack

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

爱评论不评论

近期节日

查看更多节日