Laravel get server ip

2019-10-22 10:46:31 Engres Laravel

How to get the server IP with Laravel?

Use below code to get IP address server in Laravel.

request()->server('SERVER_ADDR');

You can also use old php way to get server ip by $_SERVER['SERVER_ADDR'];

This post is submitted by one of our members. You may submit a new post here.

Related Tricks