asseco-voice/laravel-extender

This package is abandoned and no longer maintained. No replacement package was suggested.

dev-master 2020-10-20 12:42 UTC

This package is auto-updated.

Last update: 2021-06-30 08:18:29 UTC


README

evil_logo.png

Extender

This repository serves as an extension to fill in the missing pieces which are Laravel specific.

Installation

Require the package with composer require asseco-voice/laravel-extender. Service provider will be registered automatically, so no additional setup is needed.

Usage

Exposed with the service are:

  • voice:env-replace Artisan command (described below)
  • log-requests middleware logging every request url/method/data. It can be used by adding the middleware to any route/method.

Env replacer

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.

Laravel way

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)

Non-Laravel way

Having current blacklist = (X, Y, Z)
and running script like: ./script A B C
will result in blacklist = (X, Y, Z, A, B, C)