Rating & Scale Fields

Collect ratings and scale-based responses for surveys, reviews and feedback forms.

Overview

Polyform has two rating field types: rating for icon-based ratings (like star ratings) and scale for numeric scale inputs (like Likert scales or NPS). Both are validated by the RatingFieldValidator and support custom ranges and labels.

Rating Field

Use addRating() to add an icon-based rating field. Works well for star ratings, product reviews and quick feedback.

app/Actions/CreateReviewForm.php

Custom Rating Icons

You can change the icon and maximum value for rating fields.

app/Actions/CreateFeedbackForm.php

Rating Settings

SettingTypeDefaultDescription
maxinteger5Maximum rating value. Default can be configured in config/polyform.php.
iconstringstarIcon to display (e.g., "star", "heart"). Default is configurable.

Scale Field

addScale() creates a numeric scale input, good for Likert scales, NPS (Net Promoter Score) and other scale-based questions.

app/Actions/CreateSurveyForm.php

Simple Scale

For basic agreement scales or numeric ratings without labels.

app/Actions/CreateAssessmentForm.php

Scale Settings

SettingTypeDefaultDescription
mininteger1Minimum scale value.
maxinteger10Maximum scale value.
stepinteger1Step increment for the scale.
show_labelsbooleanfalseWhether to display min and max labels.
min_labelstringnullLabel text for the minimum value.
max_labelstringnullLabel text for the maximum value.

Validation

The RatingFieldValidator checks:

  • Value is a valid number
  • Value is within the configured min/max range
  • Value follows the step increment (for scale fields)
  • Required/optional status based on field configuration