Aronaman
4 months ago
651
2
Laravel

eloquent

Posted 4 months ago by Aronaman

this working in db query building I want work in eloquent

DB::table('bookings')
->select([
 DB::raw('(select pay AS payment)- (select commision_i_get AS commission) as net'),
])

Eloquent

Booking::where('organization_id',$orgId)
		->whereRaw('pay -commision_i_get ')// I don't know how to subtract the value and assign to net variable 

Please sign in or create an account to participate in this conversation.