Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting data based on the search field #785

Closed
hebertlima opened this issue Dec 11, 2023 · 1 comment
Closed

Formatting data based on the search field #785

hebertlima opened this issue Dec 11, 2023 · 1 comment

Comments

@hebertlima
Copy link

hebertlima commented Dec 11, 2023

In a scenario where masking and formatting of values are not saved in the database, is there a way to sanitize these fields before conducting a search?

For example:
In the database, the "doc" field is stored as: 4444444444, while the input for searching is 44.444.444-44.

When I perform the search like this: 44.444.444-44, it doesn't yield any results.

It only works if I search exactly like this: 4444444444.

Something like:

public function transformData()
{
    return [
        'doc' => preg_replace('/\D/', '', $this->query('doc')),
    ];
}

I am using the same field to search for names, emails, etc.

@driesvints
Copy link
Member

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants