benjaminhu / laravel-app-debug-dynamic
Enabling Laravel APP_DEBUG dynamically in production environment
1.0.0
2022-07-03 11:34 UTC
Requires
- php: >=8.0
- illuminate/http: ^5.0|^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^5.0|^6.0|^7.0|^8.0|^9.0
- laravel/framework: ^8.54
Requires (Dev)
- orchestra/testbench: ^7.6
- phpunit/phpunit: ^9.5
README
Installation
You can install the package via composer:
$ composer require benjaminhu/laravel-app-debug-dynamic
Usage
Simply register the newly created class in your (top of) middleware stack.
// app/Http/Kernel.php class Kernel extends HttpKernel { protected $middleware = [ \Benjaminhu\LaravelAppDebugDynamic\AppDebugDynamicMiddleware::class, // ... ]; // ... }
Publish config:
$ php artisan vendor:publish --provider="Benjaminhu\LaravelAppDebugDynamic\AppDebugDynamicServiceProvider"
Setup .env (remember: in production mode alway set: APP_DEBUG=false
!):
# ... APP_DEBUG=false APP_DEBUG_DYNAMIC_COOKIE_NAME=<CHOOSE COOKIE NAME> APP_DEBUG_DYNAMIC_COOKIE_SECRET=<CHOOSE COOKIE SECRET> # optional # APP_DEBUG_DYNAMIC_ALLOWED_IPS=<LIST, OF, ALLOWED, IP, ADDRESSES> # ...
Testing
$ composer test