Skip to content

Conversation

NankoPrinzhorn
Copy link

Description

When using the custom Avatar callback, we ran into issues with the newest version of Telescope. See #1579

Issue

Since version v5.6.0, it is possible to get a nullable $id and nullable $email. Which comes with unexpected behaviour compared to what the Laravel docs show.

Telescope::avatar(function (string $id, string $email) {
    return '/avatars/'.User::find($id)->avatar_path;
});

Solution

As far as i have found the moment the users object is null in the payload the UI does not show information about the user. So the idea behind this fix is to disallow nullable $id and return before any callback is triggerd.

while keeping the requested feature added in #1565

Once this is merged, I'll also create a pull request to update the Laravel docs to reflect this.
Let me know if any additional changes are need! 😊

@taylorotwell
Copy link
Member

imo we should just update the docs.

@LWlook
Copy link

LWlook commented Apr 14, 2025

@taylorotwell I'm experiencing the same issue. I believe the pull request should be considered, as this appears to be undocumented breaking change introduced in a minor version. And this could be avoided with this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants