micahdshackelford/rmap-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

micahdshackelford/rmap-laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require micahdshackelford/rmap-laravel

包简介

External relationship mapping tool

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Adds the ability to specify external foreign keys in database migrations.

Installation

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

Usage

Creating a foreign relationship (from migration)

  1. Create a new migration: php artisan make:migration [name] --create [table]
  2. Define an column & external foreign key relationship
...
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 
});
...

Creating a foreign relationship (from command)

Use php artisan rmap:create and follow the prompts.

Dropping a foreign relationship (from migration)

  1. Create a roll migration: php artisan make:migration [name] --table [table]
  2. Define an column & external foreign key relationship
...
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 
});
...

Clear all foreign relationships (from command)

Use php artisan rmap:clear and follow the prompts.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固