Request::server PHP Method

server() public static method

Retrieve a server variable from the request.
public static server ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
return string | array
        public static function server($key = null, $default = null)
        {
            return \Illuminate\Http\Request::server($key, $default);
        }

Usage Example

Example #1
0
 public function setIp()
 {
     $ipKey = ServerModel::firstOrNew(array('key' => 'ip'));
     $ipKey->value = Request::server('REMOTE_ADDR');
     $ipKey->save();
     return $ipKey->value;
 }
All Usage Examples Of Request::server