DEV Community

Muath Alsowadi
Muath Alsowadi

Posted on • Edited on • Originally published at muathye.com

3 3

With Laravel Package you can create instance real-time validation for your input in blade.

Installation

Install the package by using composer:

composer require yemeni-open-source/blade-realtime-input
Enter fullscreen mode Exit fullscreen mode

Basic Usage

The <input> tag:

<x-realtime-input::strings name="username" rules="required|min:5" />
Enter fullscreen mode Exit fullscreen mode

The <select> tag:

<x-realtime-input::options 
    rules="in:usd,yer"
    class="btn btn-default custom-select"
    name="currency" id="currency"
    >
    <option value="usd">USD</option>
    <option value="yer" selected>YER</option>
    <option value="sar">SAR</option>
</x-realtime-input::options>
Enter fullscreen mode Exit fullscreen mode

Advance Usage

You can add id, class , type or other HTML attributes to your input like following

<x-realtime-input::strings
    rules="required|min:5"
    name="username"
    id="user"
    class="form-control"
    />
Enter fullscreen mode Exit fullscreen mode

You can add array name like following

<x-realtime-input::strings
    name="username[]"
    rules="required|min:5"
    id="user"
    class="form-control"
    />
Enter fullscreen mode Exit fullscreen mode

Localization

The library works as you familiar with laravel validator you can read laravel validation localization.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay