F
Filament8mo ago
Sydd

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(), ]),
No description
No description
5 Replies
Dennis Koch
Dennis Koch8mo ago
First one is a native browser element, second one uses JS select field.
Sydd
SyddOP8mo ago
is possible to use only second type ?
awcodes
awcodes8mo ago
->rules([‘required’]) the ->required() modifier will add the required attribute to native html inputs.
Sydd
SyddOP8mo ago
thanks, and one more question, ->unique(ignoreRecord: true) validation how to ignore soft delete records too ?
LeandroFerreira
LeandroFerreira8mo ago
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#unique
Medium
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…
Want results from more Discord servers?
Add your server