Laravel Fluent add select()s in separate places?
Yeah you just insert the block you wanna execute as a function....according to the documentation on Parameter Grouping , you can do like so...by passing the Where a function...
This code below probably wont do what you want, but, its something for you to build off of, and play around with.
DB::table('users') ->where('name', '=', 'John') ->orWhere(function($query) { $query->group_by($value); ->select(DB::raw('COUNT('.$value.') as count')); }) ->get();