F
Filamentβ€’2y ago
Awady

i need to run custom rule but this rule need some form inputs as parameters

i need to run custom rule but this rule need some form input as parameters how can i get email and mobile_number value
TextInput::make('password')->password()->rules([ User::getPasswordValidationRules() , new passwordExtraValidation(request()->email , request()->mobile_number)])
Solution:
using $get https://filamentphp.com/docs/2.x/forms/validation#custom-rules ```php TextInput::make('field')->rules([...
Filament
Validation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’2y ago
using $get https://filamentphp.com/docs/2.x/forms/validation#custom-rules
TextInput::make('field')->rules([
function ($get) {
return function (string $attribute, $value, Closure $fail) use($get) {
//$get('email')...
};
},
])
TextInput::make('field')->rules([
function ($get) {
return function (string $attribute, $value, Closure $fail) use($get) {
//$get('email')...
};
},
])
Filament
Validation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Awady
AwadyOPβ€’2y ago
thank you πŸ‘
Want results from more Discord servers?
Add your server