How can we get the IP address of the user in Laravel

Laravel get ip address from request

Hello friend in this post I going to show you how to get users Ip address in Laravel 5.4 and save it is database.

  public function trackUserActivity(Request $request){
   $user_activity=new UserActivity();
   // getting  logged in user info from laravel Auth
    // Getting ip address of remote user

Leave a Reply

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