Home Laravel How to get Ip Address in Laravel?

How to get Ip Address in Laravel?

by Shahriar Sagor

Today now in this post i will show you how to get IP address in laravel application. When we are work on laravel application and we need to get the client ip address then we can get easy. We don’t need to use any $_SERVER variable as like as native PHP, but in laravel provide us the Request facade. we can fetch it easy by using following example:

Example
public function ImpressionCount(Request $request)
{
	$input['ip'] = $request->ip();
	print($input);
}

Read Also: PHP – I Can’t get the $_POST Values on Ajax Request

Thanks for read. I hope it help you. For more you can follow us on facebook.

close

You may also like