Example of unionAll in Query Builder Laravel
Sometimes you need to bind multimple query then you can use unionAll in laravel. If you use union all then laravel query builder provide unionAll method for mysql union. when you are doing big project or ERP level project then mostly you require to use union for getting data from database with multiple table. In Following example you can see how to use union all in Laravel 5.
$silver = DB::table("product_silver")
$gold = DB::table("product_gold")
I hope it can help you...
We are Recommending you
- How to Use DB Raw Query in Laravel?
- Laravel E-Signature using Docusign API Tutorial
- Laravel Login with Mobile Number OTP Tutorial
- Laravel Login and Registration using Ajax Tutorial
- Laravel Profile Image Upload Tutorial with Example
- How to Add Extra Field in Registration Form in Laravel?
- Laravel TCPDF: Generate HTML to PDF File Example
- Laravel Group By with Max Value Query Example
- Laravel Eloquent Order By Query Example
- How to use Union query with Laravel Eloquent?
- How to Execute mysql Query in Laravel?
- Laravel Query Builder Where Exists Example