Umm your question is too vague. What kind of data are you needing? Joins are done with the join method from the query builder, be warned tables with the same column names get overwritten.
I used below method and the result is getting. Is this method is correct?
$customerdetails = Customeraddress::where('customer_id', 1)
->select('company', 'firstname', 'lastname', 'street', 'city', 'customer_id')
->first();
$customerhistory = Customerhistory::where('customer_id', 1)
->select('freetext', 'DATE("created_at")')
->get();
return view('pages.social',['customerdetails' => $customerdetails, 'customerhistory' => $customerhistory]);
Your customer model should have a history and address relationships. You can then return the data from any related table through the customer model as well as query it's relationships allowing you to get users by address, history, etc.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community