Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom validation messages in editable input columns #14378

Open
wants to merge 2 commits into
base: 4.x
Choose a base branch
from

Conversation

luisprmat
Copy link
Contributor

@luisprmat luisprmat commented Sep 28, 2024

Description

Add support for custom validation messages in Editable Text Columns as Filament\Tables\Columns\TextInputColumn modifying the trait: Filament\Tables\Columns\Concerns\CanBeValidated.

This feature is already supported for Filament\Forms\Components.

Visual changes

Before:
It was not possible to customize validation messages.

use Filament\Tables\Columns\TextInputColumn;
 
TextInputColumn::make('email')
    ->rules(['unique:users,email'])

image

After:
Now is posible use

use Filament\Tables\Columns\TextInputColumn;
 
TextInputColumn::make('email')
    ->rules(['unique:users,email'])
    ->validationMessages([
        'unique' => 'The :attribute has already been registered.',
    ])

image

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@danharrin danharrin added this to the v4 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants