micahdshackelford/rmap-laravel is a Laravel package for external relationship mapping tool.
It currently has 0 GitHub stars and 4 downloads on Packagist (latest version v1.0.0).
Install it with composer require micahdshackelford/rmap-laravel.
Discover more Laravel packages by micahdshackelford
or browse all Laravel packages to compare alternatives.
Last updated
Adds the ability to specify external foreign keys in database migrations.
You can install the package via composer:
composer require micahdshackelford/rmap-laravel
Register the service provider:
in config/app.php
'providers' => [
...
/*
* Package Service Providers...
*/
MicahDShackelford\RmapLaravel\RmapLaravelServiceProvider::class,
...
]
Run the migration: 0000_00_00_000000_create_rmap_relationships_table.php
php artisan make:migration [name] --create [table]...
Schema::create('[table]', function (Blueprint $table) {
...
$table->uuid('external_uuid');
...
$table->externalForeign('test_uuid') // Name of the column on this table
->connection('external_connection') // External connection name
->on('tests') // External table
->references('uuid') // External column
->schema("default"); // (optional) Schema the external table.column lives on
});
...
Use php artisan rmap:create and follow the prompts.
php artisan make:migration [name] --table [table]...
Schema::table('[table]', function (Blueprint $table) {
$table->dropExternalForeign('test_uuid'); // Name of the column on this table
// ->connection('external_connection') // (optional) External connection name
// ->on('tests') // (optional) External table
// ->references('uuid') // (optional) External column
// ->schema("default"); // (optional) Schema the external table.column lives on
});
...
Use php artisan rmap:clear and follow the prompts.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.