How can you get users IP address in Laravel ?

You can use request’s class ip() method to get IP address of user in Laravel.

Usage:

public function getUserIp(Request $request){
// Getting ip address of remote user
return $user_ip_address=$request->ip();

}

Leave a Reply

Your email address will not be published. Required fields are marked *