Skip to content
Advertisement

How to make a union query using Laravel Eloquent and Laravel Query Builder?

I am using laravel eloquent to CRUD data. My Problem is, I don’t know how to make UNION queries using laravel Eloquent ORM. Can you help me to solve my problem?

This is my sample query that i want to implement in laravel Eloquent or Query Builder

JavaScript

Advertisement

Answer

JavaScript

or maybe you can merge the results like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement