Hi, I'm new on this lib and I have an issue making work.
I post my question on stackoverflow but I thought that I had to ask here too.
The code I have for my Role class is the following:
namespace App\Entities;
use Doctrine\ORM\Mapping as ORM;
use LaravelDoctrine\ACL\Contracts\Role as RoleContract;
use LaravelDoctrine\ACL\Contracts\HasPermissions as HasPermissionContract;
use LaravelDoctrine\ACL\Permissions\HasPermissions;
/**
* @ORM\Entity
* @ORM\Table(name="role")
*/
class Role implements
RoleContract,
HasPermissionContract
{
use HasPermissions;
/**
* @ACL\HasPermissions
*/
public $permissions;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string")
*/
protected $name;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
}
The documentation says to create a class Role that implements RoleContract.
Later on, it says to use HasPermissions trait, that implements some methods from RoleContract.
But I got an error that says me I have to implement the 'getPermissions' method.
The documentation don't say what I have to implement here, or what I have to use to fix this.
Can you please make it clear for me?
Hi, I'm new on this lib and I have an issue making work.
I post my question on stackoverflow but I thought that I had to ask here too.
The code I have for my
Role
class is the following:The documentation says to create a class
Role
that implementsRoleContract
. Later on, it says to useHasPermissions
trait, that implements some methods fromRoleContract
.But I got an error that says me I have to implement the 'getPermissions' method.
The documentation don't say what I have to implement here, or what I have to use to fix this. Can you please make it clear for me?
Thank in advance guys!