Level 50
You can do it like this, for example:
DB::table('visitor_count')->get()->groupBy('user_ip')->count()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
In my table name like visitor_count. here I store all visited user details. The table column likes user_ip, date, page, host. And finally, I want how many unique users visit on my website based on the IP address.
By getting a value in laravel query builder
Please or to participate in this conversation.