src/Defender/Repositories/Eloquent/EloquentRoleRepository.php
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]);
    }
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]);
    }
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 ] ) ; }
Create a new role with the given name.

@param $roleName

@throws \Exception

@return Role
Create a new role with the given name .