I want to collect the unique amount of visitors on my website and store them in a database. Even when someone without an account accesses the website the visitor count goes up. How can I accomplish this?
I know I have to fetch the users IP address or something along those lines but I don't know how to fetch the IP address of a user without an account when the page loads
Currently I have this DB table
Visitors
- ip
- date_visited
Route
Route::get('/', function () {
$ip = Request::ip();
return view('welcome', compact('ip'));
});