codeigniter4 / shield

Authentication and Authorization for CodeIgniter 4
https://shield.codeigniter.com
MIT License
359 stars 128 forks source link

Bug: Searching Using Like Clause Gives An Error #1047

Closed Elvis254 closed 7 months ago

Elvis254 commented 7 months ago

PHP Version

8.2.0

CodeIgniter4 Version

4.4.5

Shield Version

1.0.1

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.2

Did you customize Shield?

I customized the UserModel class to include a function to generate a full name of a user from their first and last name before insert and before update. I also customized the User entity class to include two functions to set the first and last name of a user after cleaning the string input and performing formatting on it like capitalization.

What happened?

Searching using the like clause doesn't work. Here is the code am using: auth()->getProvider()->like(['username' => $query, 'secret' => $query])->orderBy('id', 'ASC')->paginate(100, 'usersList', null, 4)

Steps to Reproduce

Include 'secret' column in the where clause so that someone can use the like clause to search for a user using both the username and email address.

Expected Output

The system should display a list of matches or no matches based on the provided query string.

Anything else?

No response