bbatsche / entrust

Role-based Permissions for Laravel 4
MIT License
3 stars 4 forks source link

Entrust\HasRole: Invalid argument supplied for foreach() #16

Closed Youbility closed 9 years ago

Youbility commented 9 years ago

Hello, I'm getting an error using Entrust::can with version 1.3:

Error

$role->perms is invalid. If I change it to $role->permissions it's working fine again. Is that a bug in Entrust?

Youbility commented 9 years ago

Should learn to read instructions carefully. My Permission and Role models did extend my own BaseModel, not EntrustRole. Odd though that everything I was using was working fine with that little change ;)

bbatsche commented 9 years ago

Hi @Youbility, glad you got this sorted out. I wanted to point out two additional things.

  1. All of my work going to version 2.0 and up. Any issues you're having with version 1.3 and before should be direct towards the original repo from zizaco.
  2. That said, one of the features I'm working on for v2.1 is refactoring the Role and Permission to use traits and interfaces rather than classes that need to be extended, so that may be well suited for your needs. Coming Soon! ;-)
Youbility commented 9 years ago

That would come in very very handy indeed :+1: The removed dependency on Ardent was already reason enough for me to upgrade to your fork. Really good work, thank you a lot. If you need help with anything please let us know.