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

User::class to getMorphClass() #33

Open
dosan opened this issue Aug 1, 2023 · 1 comment
Open

User::class to getMorphClass() #33

dosan opened this issue Aug 1, 2023 · 1 comment

Comments

@dosan
Copy link

dosan commented Aug 1, 2023

Hello!

It is correct to use 'getMorphClass' with an alias on the 'user_type' field of the History model, rather than directly specifying the '\App\User' class name.

return static::getAuth()->check() ? get_class(static::getAuth()->user()) : null;

I suggest
return static::getAuth()->check() ? static::getAuth()->user()->getMorphClass() : null;

Of course, some changes will be required in other files as well.

Thank you for your attention.

@seancheung
Copy link
Owner

Thanks! Pull requests are welcome!

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

No branches or pull requests

2 participants