Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel get ip in controller

$mytime = CarbonCarbon::now()->format('H:i d-m-Y ');
$ip = request()->ip();

 {{ucwords($mytime)}}  {{ucwords(request()->ip())}}
<div style="float:left;">{{ucwords(request()->ip())}}</div>
Comment

get ip in laravel

request()->ip();
Comment

get ip address in laravel

public function getUserIpAddr(){
       $ipaddress = '';
       if (isset($_SERVER['HTTP_CLIENT_IP']))
           $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
       else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
           $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
       else if(isset($_SERVER['HTTP_X_FORWARDED']))
           $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
       else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
           $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
       else if(isset($_SERVER['HTTP_FORWARDED']))
           $ipaddress = $_SERVER['HTTP_FORWARDED'];
       else if(isset($_SERVER['REMOTE_ADDR']))
           $ipaddress = $_SERVER['REMOTE_ADDR'];
       else
           $ipaddress = 'UNKNOWN';    
       return $ipaddress;
    }
Comment

PREVIOUS NEXT
Code Example
Php :: get month from database php 
Php :: yii2 set cookie 
Php :: how to go to another folder in php 
Php :: Pass all data to all pages laravel 
Php :: session cakephp 
Php :: PHP not working centos 8 
Php :: laravel collection reject 
Php :: PHP Function to create GUID 
Php :: wc php get product permalink 
Php :: laravel collection find duplicates 
Php :: Sending Data over another website via PHP 
Php :: php checking if array is multidimensional or not 
Php :: php end session 
Php :: angular post phph 
Php :: array prepend php 
Php :: php session destroy 
Php :: php regular expressions 
Php :: laravel store method 
Php :: get 2 days before date in php 
Php :: symfony header token authorization 
Php :: php remove array element 
Php :: phpmyadmin reset auto_increment 
Php :: steps to create laravel project 
Php :: php array sort by key value 
Php :: how to insert date in mysql using php 
Php :: web scraping in php 
Php :: sum row data and get all data eloquent laravel 
Php :: php ternary operators 
Php :: how to receive json data in php 
Php :: laravel ignore unique on update 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =