Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Why use raw?

I do stuff like this at times:

		$makes = DB::table('produced')
			->select(
					'produced.*',
					'catalog.*',
					'productions.*',
					'customers.name as customer'
				)
			->leftJoin('catalog', 'produced.catalog_id', '=', 'catalog.id')
			->leftJoin('productions', 'produced.production_id', '=', 'productions.id')
			->leftJoin('customers', 'productions.customer_id', '=', 'customers.id')
			->where('packed', '=', 0)
			->where('flagged', '=', 0, 'AND')
			->groupBy('production_id')
			->get();

OH! Maybe you are missing:

get()
0

Sign in to participate in this thread!

Eventy

Your banner here too?

hs6022841 hs6022841 Joined 2 Nov 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.