🖼️
KASKO Frontend Documentation
  • README
  • Getting started
    • Setting up a new webapp
    • Webapp manifest
    • Building the flow
    • Defining layouts
    • Defining computed values
    • Defining dynamic paths
  • Core concepts
    • Forms
    • Validation
      • Using existing validators
      • Adding custom validators
    • Configuration
      • Price format
      • Date format
    • Performing API calls
    • Toggling visibility of components
    • Translations
    • Rules For Robust Application
  • Guides
    • Using logical statements (JsonLogic)
    • Adding discount codes
    • Developing Custom Plugins
    • Setting required requests
    • Adding save quote for later
    • Transforming request data
    • Manifest merging strategy
    • Knockout flow
    • Local pricing logic
    • Setting up dashboard policy profile
    • Handling offers
    • Repeater
  • Snippets
    • Reset input state
  • Useful resources
    • All component descriptions
    • JsonLogic core documentation
    • Kasko.js documentation
    • Example webapp
    • Example plugins (w/ various frameworks)
Powered by GitBook
On this page
  • Available Laravel Validators
  • Available KASKO Validators
  • alnum_dash
  • alnum_dash_slash
  • alnum_space
  • contains_blacklist_string
  • contains_exact_blacklist_string
  • divisible_without_remainder
  • each_word_capitalized
  • iso_date
  • iso_datetime
  • required_false
  • required_false_if
  • required_if_all_false
  • required_if_and
  • required_true
  • required_true_if
  • required_true_if_and
  • sequential_char_limit
  • iban
  • bic
  • imei
  • phone_number
  • interval_before
  • interval_before_or_equal
  • interval_after
  • interval_after_or_equal
  • keyword_blacklist
  • all_caps
  • not_all_caps
  • year
  1. Core concepts
  2. Validation

Using existing validators

Last updated 9 months ago

KASKO Frontend Framework utilizes most of with the addition of some KASKO validators. These validation rules are defined in .

Note: See "" for more information how to add product-specific custom validators.

Available

Available data types (variables will be converted prior to sending to the API, but are not validated in frontend):

Available KASKO Validators

alnum_dash

Alpha-numeric characters and dash is allowed.

alnum_dash_slash

Alpha-numeric characters, dash and forward slash is allowed.

alnum_space

Alpha-numeric characters and space is allowed.

contains_blacklist_string

Fails validation if the given input matches a value in the blacklist.

contains_blacklist_string:hello,world
Value
Validation passes?

1hello

No

This is my hello text.

No

contains_exact_blacklist_string

Fails validation if the given input exactly matches a value in the blacklist (full words).

contains_exact_blacklist_string:hello,world
Value
Validation passes?

1hello

Yes

This is my hello text.

No

divisible_without_remainder

Check if the input value is divisible by X without a remainder.

divisible_without_remainder:100
Value
Validation passes?

123

No

12300

Yes

each_word_capitalized

Check if each word in the input is capitalized.

Value
Validation passes?

hello World

No

Hello World

Yes

iso_date

iso_datetime

required_false

Input must be false to pass the validation.

required_false_if

Input must be false if additional field match the given value.

required_false_if:data.additional_info,true

required_if_all_false

Input under validation is required if all other (given) fields are false.

required_if_all_false:data.field_two,data.field_three

required_if_and

Input under validation is required if all other (given) fields match the given values.

required_if_and:data.other_field_name,other_field_value,data.another_field_name,another_field_value

required_true

Input must be true to pass the validation.

required_true_if

Input must be true if additional field match the given value.

required_true_if:data.additional_info,value

required_true_if_and

Input must be true if all other (given) fields match the given values.

required_true_if_and:data.other_field_name,other_field_value,data.another_field_name,another_field_value

sequential_char_limit

Check if input doesn't have more than (given) limit of sequential characters.

sequential_char_limit:3

iban

Check if input has a valid iban code, for this validation we are using 3rd party library.

First check is done by our framework:

  • can contain only A-Z and 0-9 (letters and numbers)

Next are 3rd party library checks:

  • if is, then check against selected country's IBAN length

  • check against selected country's IBAN structure

  • and then check and calculate MOD 97-10 of the passed IBAN as specified in ISO7064

bic

Check if input has a valid bic code.

Code should consist from 8 to 11 chars. First 6 chars should be A-Z, next 2 should be A-Z or 0-9 and then last 3 are optional which should be A-Z or 0-9.

imei

Check if input has a valid IMEI code - consists of 15 digits and is valid using Luhn formula.

phone_number

Check if input has a valid phone number

interval_before

Check if input value (date) is between the given time interval.

interval_before:data.trip_start_date,+91 days

value must be between time period trip_start_date and +91 days

interval_before_or_equal

Check if input value (date) is between the given time interval or equal.

interval_after

Check if input value (date) is between the given time interval.

interval_after_or_equal:data.policy_start_date,-100 years

value must be between time period -100 years and policy_start_date

interval_after_or_equal

Check if input value (date) is between the given time interval or equal.

keyword_blacklist

Fails validation if the given input matches a value in the blacklist. Validation is case sensitive and blacklisted keyword can be a sentence.

keyword_blacklist:hello,world,some text,. hello
Value
Validation passes?

1hello

Yes

This is my hello text.

No

sometext

Yes

Need to write some text.

No

. hello world

No

all_caps

Check if each letter in the input is capitalized.

not_all_caps

Input value (string) can't have all capital letters.

Value
Validation passes?

HeLLo WorLD

Yes

HELLO WORLD

No

year

Input is validated against the provided rule which contains two arguments - a comparison operator and year.

year:>=,1890|year:<=,2000

Check if the input is a valid date.

Check if the input is a valid datetime.

check if first 2 chars from IBAN is registered in 3rd party library's supported country codes list. You can find this list .

Laravel Validators
field definitions
Adding Custom Validators
Laravel Validators
after
sometimes
after_or_equal
alpha_num
before
before_or_equal
email
gt
gte
in
max
min
not_in
regex
required
required_if
required_without
size
string
integer
boolean
number
array
ISO 8601
ISO 8601
here