Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Front End

    • Accessories
    • Addresses
    • Algolia
    • Audits
    • Auth
    • Bookmarks
    • Calendar
    • Card
    • Cargo Partner
    • Categories
    • Charts
    • Checkbox
    • Clipboard
    • Comments
    • Commercial
    • Companies
    • Confirmation
    • Currencies
    • Data Import
    • Date
    • Datepicker
    • Directives
    • Discounts
    • Divider
    • Documents
    • Dropdown
    • Dropdown Indicator
    • Eav
    • Emag
    • Emails
    • Enums
    • ERD
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Holidays
    • How to
    • Interactions
    • Inventory
    • IO
    • Laravel Validation
    • Loader
    • Localisation
    • Logs
    • Measurement Units
    • Meili Search
    • Menus
    • Mixins
    • Modal
    • Money
    • Monitored Emails
    • Notifications
    • Orderable Trees
    • Packaging Units
    • Pagination
    • People
    • Permissions
    • Product Lots
    • Products
    • Progress Bar
    • Progress Circle
    • Progress Indicator
    • Questionnaires
    • Quick View
    • Range Slider
    • Rating
    • Roles
    • Route Mapper
    • Sale Channels
    • Scroll to Top
    • Search Mode
    • Select
    • Sentry
    • Services
    • Smart Bill
    • SMS Advert
    • Strings
    • Switch
    • Tables
    • Tabs
    • Tasks
    • Teams
    • Textarea
    • Themes
    • Ticketing
    • Toastr
    • Transitions
    • Tree View
    • Tutorials
    • Typeahead
    • Typesense
    • UI
    • Uploader
    • UPS
    • User Groups
    • Users
    • Virtual Call Center
    • Vouchers
    • Webshop
    • WYSIWYG

Laravel Validation

LicenseStableDownloadsVueJavaScriptSCSSnpmIssuesMerge Requests

Description

Laravel Validation provides the small error-bag helper used by Enso forms and other frontend flows that consume Laravel validation responses.

Installation

Install the package:

yarn add @enso-ui/laravel-validation

The helper can be used inside or outside the Enso ecosystem.

Features

  • exports a single Errors helper class
  • stores validation messages keyed by field name
  • offers helpers for checking, reading, and clearing errors
  • matches the payload shape produced by Laravel validation responses

Usage

import Errors from '@enso-ui/laravel-validation';

const errors = new Errors();
errors.set({ email: ['The email field is required.'] });
errors.has('email');

API

Errors

Small mutable error-bag helper used by Enso form components.

Import: @enso-ui/laravel-validation

Methods:

  • all() returns the full error object.
  • any() returns true when at least one field has errors.
  • clear(field) removes the named field from the bag.
  • empty() removes every stored field.
  • first() returns the first available validation message.
  • get(field) returns the first message for one field.
  • has(field) checks whether the field exists in the bag.
  • set(errors) replaces the bag with a Laravel-style error payload.

Depends On

  • vue consumers such as @enso-ui/forms, @enso-ui/select, and higher-level Enso packages use this helper to normalize backend validation errors.

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

License

MIT

Edit this page on GitHub
Last Updated: 4/21/2026, 12:26:52 PM
Prev
IO
Next
Loader