PHPackages                             ajcastro/fk-adder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ajcastro/fk-adder

ActiveLibrary[Database &amp; ORM](/categories/database)

ajcastro/fk-adder
=================

Lets you add foreign keys in a swift! Foreign key adder in laravel migration.

v1.2.0(7y ago)43.6k1[2 issues](https://github.com/ajcastro/fk-adder/issues)[1 PRs](https://github.com/ajcastro/fk-adder/pulls)MITPHPPHP &gt;=5.4.0

Since Jun 11Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ajcastro/fk-adder)[ Packagist](https://packagist.org/packages/ajcastro/fk-adder)[ RSS](/packages/ajcastro-fk-adder/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)DependenciesVersions (12)Used By (0)

FkAdder for Laravel Migration
-----------------------------

[](#fkadder-for-laravel-migration)

Lets you add foreign keys smart and easy! Foreign key adder for laravel migration. For Laravel `4.2` and `5.*`.

The purpose of `FkAdder` is to simplify declaration of foreign key columns in migration.

##### Things that `FkAdder` do for you:

[](#things-that-fkadder-do-for-you)

- **Remembers the data type of a foreign key**, and it will provide the correct data type for you, so that you don't have to recall the data type of foreign key column whenever you need that particular foreign key.
- **Lets you create migration tables in any order**. This solves the problem when your table is created prior than the reference table. Usually this may cause error like `Reference table some_table does not exist`, this happens when referencing the table which are to be migrated on last part of migrations.
- **Speeds up laravel migration development.**

### Installation

[](#installation)

`composer require ajcastro/fk-adder`

### Alias

[](#alias)

Add alias into `config/app.php` file. You can skip this because of laravel's auto-discovery.

```
 'Fk' => FkAdder\Fk::class
```

### Configuration

[](#configuration)

Create a config file named `config/fk_adder.php`

```
