Union in laravel use Illuminate\Support\Facades\DB; $first = DB::table(‘users’) ->whereNull(‘first_name’); $users = DB::table(‘users’) ->whereNull(‘last_name’) ->union($first) ->get(); You Might Also Like Laravel fetch data in details November 21, 2023 Jquery php/laravel datatable February 19, 2024 Chat Notification using laravel December 26, 2023 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.