Last active
December 19, 2019 14:31
-
-
Save rickslayer/502731d714cd547059252dea3acf865e 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
--Simple Where | |
Model::where('field', '*operator', 'value'). | |
//*operator = "< , >, =, =>, =< etc" | |
-- Between where | |
Model::whereBetween('field',['value1', 'value2']); | |
-- Raw Where for exclusive treatments | |
Model::whereRaw('LEFT(field, 4) = tesssttteeee') | |
//Left JOin | |
Model:leftJoin('table', 'table.id', '=', 'Model id') | |
//If in where | |
->when($filter, function($q) { | |
return $q->where("field", '=', 0); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment