thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server
https://oauth2.thephpleague.com
MIT License
6.51k stars 1.12k forks source link

Update Laravel example to work when configuration is cached #1256

Closed Krisell closed 2 years ago

Krisell commented 2 years ago

The Laravel example of reading the application key doesn't work in a production setting where the configuration cache is used. All calls to env() return null then and config() should be used instead.

Using config('app.key') always works, cached or not. Of course a Laravel developer already knows this so the risk of it causing an actual problem is very low, but I think any Laravel example should follow Laravel conventions.

Laravel documentation about this https://laravel.com/docs/8.x/deployment#optimizing-configuration-loading

Sephster commented 2 years ago

Thanks for this @Krisell - happy to merge