Created
July 26, 2016 20:44
-
-
Save anonymous/0eb25d2fe5f3b702e9096c4ec2ac65e8 to your computer and use it in GitHub Desktop.
filter
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
Post::whereHas('tags', function ($query) use ($t) { | |
$query->where('tag_id','=', $t); | |
})->whereHas('languages', function ( $query ) use ( $l ){ | |
$query->where('language_id', '=',$l); | |
})->orWhere(function ($q) use ($search) { | |
$q->where('title', 'LIKE', '%' . $search . '%') | |
->orWhere('explanation','LIKE','%'.$search.'%') | |
->orWhere('usage','LIKE','%'.$search.'%') | |
->orWhere('codeexample','LIKE','%'.$search.'%') | |
->orderBy('id','desc'); | |
})->get(); |
kemalkanok
commented
Jul 26, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment