Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Using loginAs with id #922

Merged
merged 1 commit into from
Sep 7, 2021
Merged

[6.x] Using loginAs with id #922

merged 1 commit into from
Sep 7, 2021

Conversation

binotaliu
Copy link
Contributor

loginAs method allows you to pass a User eloquent model instance or an integer of user id.

starting from PHP 8.0, when passing an integer to method_exists as its first argument, PHP will throws a FatalError.

This PR fixes it by checking if $userId is an object first.

References:

@taylorotwell taylorotwell merged commit ad414af into laravel:6.x Sep 7, 2021
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