Skip to content
Advertisement

Tag: backend

Laravel how merge two query results into a single object

I’m currently stuck on how to merge two query results into a single object . Below is my code. EDITED Model methods Getting values in controller Returned result: [{‘teamstanding’: ‘data’}, {‘teamstatictics’: ‘data’}] Expected output: [{‘teamstanding’: ‘data’, ‘teamstatictics’: ‘data’}] Answer You can use all() function.

Advertisement