# Upgrading to v4 from 3.x

{% hint style="info" %}
This upgrade guide only discusses upgrading Socialstream 4.x and assumes you are upgrading from an **unaltered 3.x install**. Upgrading Jetstream, Livewire, Inertia, Vue or Tailwind CSS is out of scope for this documentation. Please consult the upgrade guides for each of these packages instead.
{% endhint %}

## Overview <a href="#user-content-changes" id="user-content-changes"></a>

* [Changes](#user-content-changes-1)
  * [Native Type Declarations](#user-content-changes-2)
  * [User Profile Photo](#user-profile-photo)
  * [Inertia Props](#changes-to-jetstream-props-in-inertia)

***

## Changes <a href="#user-content-changes" id="user-content-changes"></a>

### **Native Type declarations** <a href="#user-content-changes" id="user-content-changes"></a>

{% hint style="danger" %}
Impact: **High**
{% endhint %}

Version 4.x updates the interfaces and published `php` files to use native type declarations. Please ensure the following files have been updated to match their interface counterparts:

```
CreateConnectedAccount.php
CreateUserFromProvider.php
HandleInvalidState.php
ResolveSocialiteUser.php
SetUserPassword.php
UpdateConnectedAccount.php
```

### **User Profile Photo**

{% hint style="danger" %}
Impact: **High**
{% endhint %}

If you have included the `HasProfilePhoto` trait in your user model, please update your model to the following:

```diff
    use HasProfilePhoto {
-       getProfilePhotoUrlAttribute as getPhotoUrl;
+       HasProfilePhoto::profilePhotoUrl as getPhotoUrl;
    }
```

And replace the `getProfilePhotoUrlAttribute` method in the model with:

```php
/**
 * Get the URL to the user's profile photo.
 */
public function profilePhotoUrl(): Attribute
{
    return filter_var($this->profile_photo_path, FILTER_VALIDATE_URL)
        ? Attribute::get(fn () => $this->profile_photo_path)
        : $this->getPhotoUrl();
}
```

### **Inertia Props**

{% hint style="danger" %}
Impact: **High**
{% endhint %}

If you're using Inertia, please update your `Profile/Show.vue` file to the following:

```diff
-29:                    <UpdateProfileInformationForm :user="$page.props.user" />
+29:                    <UpdateProfileInformationForm :user="$page.props.auth.user" />
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.socialstream.dev/prologue/upgrade-guide/upgrading-to-v4-from-3.x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
