Php: how to lower complexity of method
Your three catch blocks and two returns do the same thing as each other.  You only need one of each.

$update is referenced outside of try, should be defined there too.

$current_public_ip is just another name for $data[ 'ip_address' ].  It's not any shorter or clearer and doesn't resemble its other name very closely.

$previous_public_ip isn't an IP address, it's an object that contains an IP address and other stuff.  It would be clearer to simply name it $previous, which lets you drop the redundant string_ from $string_previous_public_ip.  _public can go too.

public function update()
{
    $update = false;
    $status = 500; // default
    try {
        $data = array();
        $previous_ip = null;
        $data[ 'ip_address' ] = $this-&gt;getGateway()-&gt;fetchPublicIp($this-&gt;getIp());
        $previous = $this-&gt;getGateway()-&gt;getLastRecord();
        if ( isset($previous-&gt;ip_address) ) {
            $previous_ip = $previous-&gt;ip_address;
            $data[ 'id' ] = $previous-&gt;id;
        }
        if ( $data[ 'ip_address' ] != $previous_ip ) {
            $update = $this-&gt;updateOrCreate($data);
        }
        $status = 200;
    } catch ( \Exception $e ) {
        // return default status (500)
    }
    return response()-&gt;json([ 'updated' =&gt; $update ], $status);
}