This repository serves as an extension to fill in the missing pieces which are Laravel specific.
Require the package with
composer require asseco-voice/laravel-extender.
Service provider will be registered automatically, so no additional setup is needed.
Exposed with the service are:
voice:env-replaceArtisan command (described below)
log-requestsmiddleware logging every request url/method/data. It can be used by adding the middleware to any route/method.
Script which is ultimately responsible for creating a working .env file from .env.example. It works in a way that it replaces environment variables in Laravel with shell counterparts. If there exists no environment variable inside the shell, .env.example default value is used for given variable.
If used alongside Docker, environment variables can be set either through command line or within a docker-compose file.
Laravel .env.example: DB_HOST=127.0.0.1 DB_USER=root Shell env variable: DB_HOST=192.168.0.1 Final .env: DB_HOST=192.168.0.1 DB_USER=root
blacklist is an optional argument that can be used to filter out values which are
forbidden to change.
Having current blacklist = (X, Y, Z) and running script like: php artisan asseco:env-replace A B C will result in blacklist = (X, Y, Z, A, B, C)
Having current blacklist = (X, Y, Z) and running script like: ./script A B C will result in blacklist = (X, Y, Z, A, B, C)