Invalid feedback text
Dear all, please let me know why in the first case is showing feedback defualt browser ? and second better as invalid feedback text under input.
1. Forms\Components\TextInput::make('email')
->label('Email')
->required(),
2.Forms\Components\Section::make()
->columns(1)
->schema([
Forms\Components\Select::make('roles')
->label('Priradené role používateľa')
->relationship('roles', 'roleName')
->multiple()
->required(),
]),
5 Replies
First one is a native browser element, second one uses JS select field.
is possible to use only second type ?
->rules([‘required’])
the ->required() modifier will add the required attribute to native html inputs.thanks, and one more question, ->unique(ignoreRecord: true) validation how to ignore soft delete records too ?
if you are using a unique field in the database, you will have an issue if you insert the same value, because of its already exist. You can use this approach: https://hafiqiqmal93.medium.com/laravel-softdelete-avoid-unique-constraint-problem-83d18dc3621e
If you are not using a unique field, I guess you can use
modifyRuleUsing
https://filamentphp.com/docs/3.x/forms/validation#uniqueMedium
Laravel SoftDelete Avoid Unique Constraint Problem
When models are soft deleted, they are not actually removed from your database. Laravel use deleted_at field to indicate the visibility of…