Skip to content

Instantly share code, notes, and snippets.

@bmadigan
Created April 8, 2016 15:46
Show Gist options
  • Save bmadigan/3c04e24d820339a3467a9470775a4f85 to your computer and use it in GitHub Desktop.
Save bmadigan/3c04e24d820339a3467a9470775a4f85 to your computer and use it in GitHub Desktop.
// Build out the query based on the form filter request
$contractQuery = Contract::where('id', '>', '1'); // get all contracts
if($request->get('company') != '') {
$contractQuery->where('mpb_company', $request->get('company'));
}
if($request->get('status') != '') {
$contractQuery->where('status', $request->get('status'));
}
$results = $contractQuery->get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment