seancheung/history

User::class to getMorphClass()

dosan opened this issue · 1 comments

dosan commented

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.

Thanks! Pull requests are welcome!