Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucasgio/073e970253e069824b659bd1c5abe657 to your computer and use it in GitHub Desktop.
Save lucasgio/073e970253e069824b659bd1c5abe657 to your computer and use it in GitHub Desktop.
Search with concat laravel
$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