Created
August 25, 2016 21:35
-
-
Save talha08/9ede63f90f5932cd531f2e2d0e65ada4 to your computer and use it in GitHub Desktop.
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
//text | |
public function searchPostOrUser(Request $request){ | |
$text = '%'. $request->search_text.'%'; | |
// $ips_list = \DB::table('app_post')->where('title', '=', '1')->limit(5); | |
$recipes = DB::table("app_post")->select("id", "title") | |
->where("title", 'LIKE' , $text); | |
$items = DB::table("app_user")->select("id", "name") | |
->where("name", 'LIKE', $text) | |
->union($recipes) | |
->get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment