Skip to content

Instantly share code, notes, and snippets.

@beisong7
Last active November 14, 2020 05:27
Show Gist options
  • Save beisong7/489a5cc22d803c7956cfdbf8f92f0f37 to your computer and use it in GitHub Desktop.
Save beisong7/489a5cc22d803c7956cfdbf8f92f0f37 to your computer and use it in GitHub Desktop.
Basic Awesome Queries
Basic laravel Queries
- Hopefully OPtimised
@beisong7
Copy link
Author

//Joining two tables and selecting preferred info from them

$test = DB::table('item_entries')
  ->leftJoin('sales', 'item_entries.sale_item_id', '=', 'sales.sale_item_id')
  ->select('sales.qty','sales.date','item_entries.*')
  ->get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment