Let me tell you the points.
- I am using Entrust by https://github.com/Zizaco/entrust/
- I am using multi-auth i.e I have 2 guards as
web
forusers
table andadmin
guard foradmins
table. - In
admins
table there are users with multiple permissions (roles too). -
The
permission
middelware has the codeif (!Auth::guard('
admin
')->user()->can(explode('|', $permissions))) In my
Admin
model, I have useduse EntrustUserTrait;
Middelware
permission
is working fine onroutes.php
the only problem I am facing is if anyAdmin User
does not have permission supposecan-create
then the html written in the that block should be hidden in blade file.
@permission('can-create')
Lorem Ipsum...
@endpermission
the above blade directives are not highlighted as @if or @foreach etc.
I think there might be something due multi-auth I am using, since Entrust takes users
table by default.
Kindly enlighten me, considering this situation.