Download the PHP package ikechukwukalu/dynamicdatabaseconfig without Composer

On this page you can find all versions of the php package ikechukwukalu/dynamicdatabaseconfig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dynamicdatabaseconfig

DYNAMIC DATABASE CONFIG

Latest Version on Packagist Quality Score Code Quality Known Vulnerabilities Github Workflow Status Total Downloads Licence

This laravel package helps you dynamically set more database configurations through the .env file or database.

REQUIREMENTS

STEPS TO INSTALL

Introduction

The need for this package came up when I once handled an already existing project that, due to certain constraints, had 9 databases implemented for each country their application was being utilised. This application also had a central database that was used by every country as well.

The config/database file wasn't pretty. I'd prefer to have all configurations within the .env file only. The Big question was, what if the databases required grew to 19? These were the problems, both pending and existing that needed a clean hack/solution.

Middlewares

Env.database.config Middleware

This middleware fetches database configurations from the .env file using postfixes like ONE. This dynamically declares an additional database connection for your laravel application.

You would not need to add a postfix, ONE, parameter to the middleware for the $postFix variable if you simply set the following session value session(config('dynamicdatabaseconfig.session_postfix')), but when a postfix parameter has been set, it will be used instead of the session value.

Dynamic.database.config Middleware

This middleware fetches database configurations from the database_configurations table within the primary migration database. It utilises a unique $ref variable. It's recommended that the unique $ref variable should be human readable, that way it becomes easier to run the package's console commands for running migrations. This will also dynamically declare an additional database connection for your laravel application.

You would not need to add a ref, nigeria, parameter to the middleware for the $ref variable if you simply set the following session value session(config('dynamicdatabaseconfig.session_ref')), but when a ref parameter has been set, it will be used instead of the session value.

By default, the values stored within the configuration field will be hashed, but you can adjust this from the .env file by setting DB_CONFIGURATIONS_HASH=false.

Migration

It's compulsory to first migrate laravel's initial database.

Other Migrations

Default Migrations

This will only migrate files within laravel's default migration path database/migrations

Isolated Migrations

This will only migrate files within the specified migration path database/migrations/folder

Both Migrations

Running the migrations as displayed below will result in the respective database having the migrated data from migrations within database/migrations and database/migrations/folder.

Database Migration With Seeding

Re-runing Migrations Afresh

Refreshing Migrations

Rolling Back Migrations

Database Seeding

NOTE

PUBLISH MIGRATIONS

PUBLISH CONFIG

LICENSE

The DDC package is an open-sourced software licensed under the MIT license.


All versions of dynamicdatabaseconfig with dependencies

PHP Build Version
Package Version
Requires illuminate/console Version ^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/routing Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
php Version >=7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ikechukwukalu/dynamicdatabaseconfig contains the following files

Loading the files please wait ....