laravel-authentication-log
laravel-authentication-log copied to clipboard
Fix log creation in the LogoutListener to use correct class
It is possible to use a custom AuthenticationLog by overriding the authentications() and latestAuthentication() methods from the AuthenticationLoggable trait, except for this listener which tries creates a new AuthenticationLog directly. By going through the User model, we will create an object of the correct (custom) class.
This fixes the specific problem of a custom AuthenticationLog model that uses the \Illuminate\Database\Eloquent\Concerns \hasUlids trait not being successfully created here because it fails to generate the id.
Related to #108.
Rebased to develop for merging this weekend