src/Requests/RoleRequest.php
public function rules()
    {
        $return = [
            'description' => 'required|max:255',
            'name' => 'required|max:255|unique:' .
                config('roleManager.rolesTable') . ',name',
            'permission.*' => 'exists:' .
                config('roleManager.permissionsTable') . ',id'

        ];

        if (Request::isMethod('put')) {
            $role = Roles::where('id', Request::route('role'))->firstOrFail();
            if ($role->name == Request::input('name')) {
                $return['name'] = 'required|max:255';
            }
        }
        return $return;
    }
public function rules()
    {
        $return = [
            'description' => 'required|max:255',
            'name' => 'required|max:255|unique:' .
                config('roleManager.rolesTable') . ',name',
            'permission.*' => 'exists:' .
                config('roleManager.permissionsTable') . ',id'

        ];

        if (Request::isMethod('put')) {
            $role = Roles::where('id', Request::route('role'))->firstOrFail();
            if ($role->name == Request::input('name')) {
                $return['name'] = 'required|max:255';
            }
        }
        return $return;
    }
Get the validation rules that apply to the request.

@return array