Created
March 24, 2017 15:31
-
-
Save xorenio/3786ab1308d6e4f45db0a4e8ae74d466 to your computer and use it in GitHub Desktop.
laravel oem query relations
This file contains 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
<?php | |
// where has relation and key - value | |
// OR | |
// doesnt have a relation | |
->where(function($query){ | |
$query->whereHas('report', function($q){$q->where('accepted', '<=', '0');}) | |
->orWhereHas('report', function($q){$q;}, '<', 1); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment