Laravel - LIKE operator to search for encrypted values
问题 I am trying to implement a search module in my Laravel app that could filter users by name. In order to protect users, the 'name' column rows are encrypted on DB. The problem that I am facing is that query below always returns 0 results. I am encrypting the search input value before searching into DB. $patients = DB::select( DB::raw("SELECT * FROM patient WHERE name LIKE '%".Crypt::encrypt($searchText)."%';")); What am I doing wrong here ? 回答1: Crypt::encrypt("Text") The above will rarely