Laravel get server ip

2020-06-05 01:12:07 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