Query gives empty excel, with join #3412
Unanswered
ruturaj-vaidya22
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi , i have read the documentation and it says not to use get(), but couldn't find a relevant piece of code of how to go about when it comes to DB:: and join. Please guide me on how should I do it under query. What should I replace get() with and if db::raw then how should be the syntax? An example would be of great help to me and others like me.
$this->complaints = DB::table('complaints')
->join('customers', 'customers.id', '=', 'complaints.customer_id')
->join('technicians', 'technicians.id', '=', 'complaints.technician_id')
->select(DB::raw('complaints.*' , 'customers.first_name','customers.last_name',
'customers.number', 'customers.email_address', 'customers.occupancy_name',
'customers.building_number', 'customers.house_number',
'customers.taluka', 'customers.city', 'customers.address', 'customers.package',
'customers.package_date', 'customers.package_status', 'customers.package_period',
'technicians.first_name as t_fname', 'technicians.last_name as t_lname','technicians.number as t_number'))
Beta Was this translation helpful? Give feedback.
All reactions