Skip to content

[6.x] Use ->getAuthIdentifier() instead of ->id() - #15313

Merged
jasonvarga merged 1 commit into
statamic:6.xfrom
Jade-GG:patch-8
Aug 31, 2026
Merged

[6.x] Use ->getAuthIdentifier() instead of ->id()#15313
jasonvarga merged 1 commit into
statamic:6.xfrom
Jade-GG:patch-8

Conversation

@Jade-GG

@Jade-GG Jade-GG commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The Auth::guard() function returns Authenticatable|null. The Authenticatable contract doesn't have an id() function, instead it has getAuthIdentifier().

Note that the getAuthIdentifier function is already overwritten in the default User authenticatable class that Statamic uses, so I don't see any issue with changing this to the standard function here.

We ran into an issue with this, as this function was being called upon our own User model that we use in our storefront. While that's probably going to be a separate issue to look into, I figured it was at least worth making this change regardless.

@jasonvarga
jasonvarga merged commit 9dfd626 into statamic:6.x Aug 31, 2026
62 checks passed
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.

2 participants