Awady
how can i show/hide filter according to another filter ?
SelectFilter::make('class')
->options(function () {
return ParticipationClass::get()->pluck('name', 'id')->toArray();
})->query(function (Builder $query, $data): Builder {
if (!empty($data['value'])) {
dd($data);
$data = ParticipationClass::find($data['value']);
$participants = $data->participants->pluck('id');
return $query->wherein('relatable_id', $participants);
}
return $query;
})
->visible(function (): bool {
//todo
}),
----------------------------------------------------------------------------------------------------------
-this is my code i need to get another filter value inside visible closure to show hide filter according to this boolean .
1 replies
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)])
TextInput::make('password')->password()->rules([ User::getPasswordValidationRules() , new passwordExtraValidation(request()->email , request()->mobile_number)])
5 replies