src/models/Permissions/Permission.php
public function validate()
    {
        if(!$name = $this->getName()) {
            throw new NameRequiredException("A name is required for a permission, none given.");
        }

        if(!$value = $this->getValue()) {
            throw new ValueRequiredException("A value is required for a permission, none given.");
        }

        // Check if the permission already exists
        $query = $this->newQuery();
        $persistedPermission = $query->where('value', '=', $value)->first();

        if($persistedPermission and $persistedPermission->getId() != $this->getId()) {
            throw new PermissionExistsException("A permission already exists with value [$value], values must be unique for permissions.");
        }

        return true;
    }
public function validate()
    {
        if(!$name = $this->getName()) {
            throw new NameRequiredException("A name is required for a permission, none given.");
        }

        if(!$value = $this->getValue()) {
            throw new ValueRequiredException("A value is required for a permission, none given.");
        }

        // Check if the permission already exists
        $query = $this->newQuery();
        $persistedPermission = $query->where('value', '=', $value)->first();

        if($persistedPermission and $persistedPermission->getId() != $this->getId()) {
            throw new PermissionExistsException("A permission already exists with value [$value], values must be unique for permissions.");
        }

        return true;
    }
Validate permissions
@return bool