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

TextInput::make('field')->rules([
    function ($get) {
        return function (string $attribute, $value, Closure $fail) use($get) {
            //$get('email')...
        };
    },
])
Filament
The elegant TALL stack form builder for Laravel artisans.
Was this page helpful?