This is working for me:
$user_info = DB::table('usermetas')
->select('browser', DB::raw('count(*) as total'))
->groupBy('browser')
->get();
More Related Contents:
- Migration: Cannot add foreign key constraint
- Eloquent Collection: Counting and Detect Empty
- Eloquent eager load Order by
- Laravel. Use scope() in models with relation
- Laravel Eloquent “WHERE NOT IN”
- How to access model hasMany Relation with where condition?
- Eloquent push() and save() difference
- Laravel save / update many to many relationship
- First Or Create
- Laravel: Returning the namespaced owner of a polymorphic relation
- Polymorphic Eloquent relationships with namespaces
- Clone an Eloquent object including all relationships?
- Laravel – Eloquent “Has”, “With”, “WhereHas” – What do they mean?
- Laravel redirect back to original destination after login
- How to install Laravel 4 to a web host subfolder without publicly exposing /app/ folder?
- How can I resolve “Your requirements could not be resolved to an installable set of packages” error?
- Laravel Redirect Back with() Message
- Laravel Fluent Query Builder Join with subquery
- laravel with() method versus load() method
- Laravel Eloquent: How to order results of related models?
- Laravel Controller Subfolder routing
- How to use paginate() with a having() clause when column does not exist in table
- Select Last Row in the Table
- How to get distinct values for non-key column fields in Laravel?
- Where can I set headers in laravel
- What is the difference between queue:work –daemon and queue:listen
- How to select specific columns in laravel eloquent
- How to setup conditional relationship on Eloquent
- Laravel Many to many self referencing table only works one way
- Laravel Eloquent – Where In All