I tested it in the Lumen 5.5.* project which didn't register AuthServiceProvider and resulted in the following alert.
"InvalidArgumentException: [0] Auth guard driver [api] is not defined."
It was because $request->user() tries to get authenticated user with default guard api which is not defined. Would it be better that setUserContext in RecordTransaction is conditional based on configuration?
I tested it in the Lumen 5.5.* project which didn't register
AuthServiceProvider
and resulted in the following alert.It was because
$request->user()
tries to get authenticated user with default guardapi
which is not defined. Would it be better thatsetUserContext
inRecordTransaction
is conditional based on configuration?