Artesaos\Defender\Repositories\Eloquent\EloquentRoleRepository::create PHP Method

create() public method

Create a new role with the given name.
public create ( $roleName ) : Artesaos\Defender\Contracts\Role
$roleName
return Artesaos\Defender\Contracts\Role
    public function create($roleName)
    {
        if (!is_null($this->findByName($roleName))) {
            // TODO: add translation support
            throw new RoleExistsException('A role with the given name already exists');
        }
        return $role = $this->model->create(['name' => $roleName]);
    }
EloquentRoleRepository