This module will connect through an external database to periodically pull in data stored in another database. The metrics can that you want to pull in have to be defined in the config
file and the migration is generated by an Artisan command.
- Require the package with
composer require basduchambre/external-db-connect
(not working, not on packagist yet...) - Install the package with
php artisan externaldb:install
- This will publish a config call in your Laravel config dir named
externaldb.php
- Configure the database connection settings and the columns to be fetched, make sure the naming is identical of the columns you're targeting
- To generate a migration file, use the command
php artisan externaldb:migration
- TODO ...
- Remote access has to be enabled on the database that will be called upon
- Service provider
- Migration file
- Config file
- External DB connect settings
- Measurement interval in minutes, e.g. 1 hour will be (int) 60
- Metrics to pull identified by column name as array, e.g. ['email_address', 'zip_codes', 'location']
- Artisan command to generate migration based on config
- Artisan command, e.g.
php artisan externaldb:fetch
- Controllers
By creating a composer package it will be easy to add this to the core API, or leave it out when not needed.