Description
What should be added?
I'm developing for Laravel Octane. One issue I ran into is that the default configuration for the package is to use cookies for the sessionStorage & transientStorage. The PHP SDK's CookieStore
will call setcookie()
, which won't work when running on Octane1.
I didn't see anything in the Laravel package to offer another driver, so I implemented a StoreInterface
that uses the the framework's sessions.
However: It was a little difficult to configure this. It didn't look like I could just give the two storage parameters the classpath in config/auth0.php
; it expected instances. That's a bit of a bummer since caching the config would fail2.
I have two suggestions for enhancements of the Laravel package:
- When a parameter in
config/auth0.php
is expected to be an object, allow it to be specified as a classpath and have the service container resolve it. - Add a
StoreInterface
implementation that uses the framework's session driver.
Footnotes
-
See the Laravel Swoole notices, specifically point number 6. ↩
-
Running
php artisan config:cache
is what fails if you passnew MyCoolStorageDriver
. I think I could have made the classes serializable to make it work, but that seems very un-Laravel-y. ↩