Last active
August 17, 2021 01:55
-
-
Save lucasgio/073e970253e069824b659bd1c5abe657 to your computer and use it in GitHub Desktop.
Search with concat laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = People::where(DB::raw("CONCAT(first_name, ' ', last_name)"), 'like', "%" . $search . "%") | |
->orWhere('phone', 'like', '%' . $search . '%') | |
->orWhere('mobile_phone', 'like', '%' . $search . '%') | |
->orWhere('customer_type_id', 'like', '%' . $search . '%')->paginate(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment