laravel-permission: Can't check two specific roles

I tried searching and thinking of a solution but I couldn’t come up with one… I have an application where writer can only write post and editor can only edit post. For this i check for a specific role @role('writer') I am a writer! @endrole But i have a third user admin and admin can write and edit post for this i have done this @role('writer|admin') I am a writer! @endrole but this didn’t work. I have tried other options too `@hasanyrole(‘writer|admin’)

@endhasanyrole` But Did not work

Thanks for this amazing package and for possible feedback!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17

Most upvoted comments

For checking multiple roles in blade, the @hasanyrole directive does it.

@hasanyrole('writer|admin')
    I am either a writer or an admin or both!
@else
    I have none of these roles...
@endhasanyrole