Illuminate\Auth\AuthManager" prop. missing

I’m trying to protect my profile edition page by using the following code:

auth()->$user->profile->update($data);

However, I’m getting the following error:

undefined property: Illuminate\Auth\AuthManager::${“id":1,“name”:“mourad”,“surname”:“BENOSB”,“email”:"mourad.benosmane@gmail.com”,“email_verified_at”:null,“created_at”:“2020-01-04 11:41:28”,“updated_at”:“2020-01-04 11:41:28”} http://127.0.0.1:8000/profile/1

The error is caused by a syntax error in the code. The correct syntax to access the currently authenticated user is auth()->user(), not auth()->$user. The correct code should be:

auth()->user()->profile->update($data);