spatie / laravel-activitylog

Log activity inside your Laravel app
https://docs.spatie.be/laravel-activitylog
MIT License
5.3k stars 712 forks source link

Handle activity logging with no`AuthManager` more gracefully #1182

Closed alistaircol closed 1 year ago

alistaircol commented 1 year ago

I recently installed this package on a project where we are serving an internal microservice API which has no need to have users/auth/cookies, etc.

So we have it so that AuthServiceProvider and CookieServiceProvider providers aren't being loaded.

versions * php 8.1 * laravel 9.47.0 * spatie/laravel-activitylog 4.7.3

When I was doing some activity logging activity()->log('whatever') (attempted with causedBy(null), causedByAnonymous(), etc.) I was encountering an issue.

Target class [auth] does not exist.

This PR will resolve this.