PHPackages                             mylesduncanking/laravel-simple-migration - 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. mylesduncanking/laravel-simple-migration

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

mylesduncanking/laravel-simple-migration
========================================

Streamlined class for simple migrations within Laravel

v2.1.8(5mo ago)12491MITPHPPHP &gt;=7.3

Since Jul 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/mylesduncanking/laravel-simple-migration)[ Packagist](https://packagist.org/packages/mylesduncanking/laravel-simple-migration)[ Docs](https://github.com/mylesduncanking)[ RSS](/packages/mylesduncanking-laravel-simple-migration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (22)Used By (0)

Laravel Simple Migration
========================

[](#laravel-simple-migration)

📦 Installation
--------------

[](#-installation)

```
composer require mylesduncanking/laravel-simple-migration
```

---

❓ Why Use This Package?
-----------------------

[](#-why-use-this-package)

Laravel's migrations are powerful but can become verbose and repetitive, especially for simple table structures or frequent seed/migrate workflows.

**Laravel Simple Migration** helps you:

- Write cleaner, array-based migration definitions
- Avoid boilerplate like `->after()` and `->index()`
- Automatically run seeders alongside migrations
- Maintain clarity and control with a minimal syntax layer

Perfect for rapid prototyping, internal tools, or any dev who loves less noise and more flow.

---

🚀 Getting Started
-----------------

[](#-getting-started)

This package builds on Laravel's native migration system. If you're familiar with [Laravel migrations](https://laravel.com/docs/9.x/migrations), this will feel familiar.

To create a simple migration:

```
php artisan make:simple-migration your_migration_name
```

Your migration file will contain a `$migration` array for defining schema changes.

### Format

[](#format)

```
protected array $migration = [
    'TABLE_NAME' => [
        'COLUMN_NAME' => ['MODIFIERS'],
        // Additional columns...
    ],
    // Additional tables...
];
```

---

🔁 Auto-After Functionality
--------------------------

[](#-auto-after-functionality)

To save time when adding multiple columns, this package adds them sequentially by default. This removes the need for `->after('column')`.

To disable this:

```
php artisan vendor:publish --tag=simplemigration
```

Then set `config/simplemigration.php > auto_after` to `false`.

---

⚡ Auto-Index Functionality
--------------------------

[](#-auto-index-functionality)

By default, any column ending in `_id` will automatically get an `->index()` modifier.

Customize this behavior:

```
php artisan vendor:publish --tag=simplemigration
```

Then edit the regex rules in `config/simplemigration.php > auto_index`.

To exclude a specific column from auto-indexing, add `noIndex` in its modifiers array.

---

🌱 Seeder Functionality
----------------------

[](#-seeder-functionality)

Table creations or updates often require seeders. This package uses Laravel's migration tracking to automatically run seeders during the `up()` method.

This package assumes that seeders are stored under `\Seeds` namespace and have a class name that starts with a capital letter and ends with `Seeder`.

```
protected array $seeders = [
    'roles', // This will translate to (new \Seeds\RolesSeeder())->run()
];
```

> **Note:** Seeders only run during `up()` by default. To run seeders during rollback (`down()`), use `beforeDown()` or `afterDown()` and call `runSeeder($seederName)` manually.

---

📘 Table Naming Convention
-------------------------

[](#-table-naming-convention)

If a table includes an `id` or `uuid` column, it is assumed to be a new table. Otherwise, the table is assumed to be updated.

To explicitly define the action, use:

- `create:table_name`
- `update:table_name`

Or adjust assumptions globally:

```
config/simplemigration.php > type_assumptions
```

### Example

[](#example)

```
protected array $migration = [
    'table_to_be_created' => [
        'id',
        'name',
        'date:dob' => ['nullable'],
        'timestamps',
    ],

    'table_to_be_updated' => [
        'name' => ['after:id']
    ],

    'create:pivot_table' => [
        'foreignId:key_1' => ['index'],
        'foreignId:key_2' => ['index'],
    ],
];
```

---

🏷️ Column Key Format
--------------------

[](#️-column-key-format)

Format keys as `{type}:{column}`.

### Examples:

[](#examples)

- `integer:quantity`
- `set:status`
- `foreignId:user_id`
- `date:dob` =&gt; \['nullable'\]

---

✅ Supported Modifiers
---------------------

[](#-supported-modifiers)

You can use all default Laravel column modifiers in array format:

- `nullable`
- `default:value`
- `unique`
- `index`
- `after:other_column`
- `comment:some text`
- `noIndex` (custom)

---

✨ Helper Methods
----------------

[](#-helper-methods)

### beforeDown()

[](#beforedown)

Hook to perform actions before the `down()` method runs.

### afterDown()

[](#afterdown)

Hook to perform actions after the `down()` method runs.

### runSeeder($seeder)

[](#runseederseeder)

Run a seeder manually.

---

✏️ Example Seeder Triggered in Migration
----------------------------------------

[](#️-example-seeder-triggered-in-migration)

```
protected array $migration = [
    'roles' => [
        'id',
        'name',
    ],
];

protected array $seeders = [
    'Role'
];
```

This will run `RoleSeeder` when the migration is applied.

---

📁 Config File
-------------

[](#-config-file)

To customize assumptions and toggles:

```
php artisan vendor:publish --tag=simplemigration
```

Edit `config/simplemigration.php` to:

- Enable/disable auto-index or auto-after
- Add custom regex rules
- Set type assumptions for new vs update

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance73

Regular maintenance activity

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~55 days

Total

21

Last Release

152d ago

Major Versions

v1.2.7 → v2.0.02025-01-03

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0|^8.1

v1.2.6PHP ^7.3|^8.0|^8.1|^8.2

v2.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed96372ac30dea78a6eb905add8d048ac1ff98e80fdb6e6ba42cb1c21a1abdc4?d=identicon)[mylesduncanking](/maintainers/mylesduncanking)

---

Top Contributors

[![mylesduncanking](https://avatars.githubusercontent.com/u/19204499?v=4)](https://github.com/mylesduncanking "mylesduncanking (48 commits)")[![Sophist-UK](https://avatars.githubusercontent.com/u/3001893?v=4)](https://github.com/Sophist-UK "Sophist-UK (1 commits)")

---

Tags

laravelmigrationSimplestreamlined

### Embed Badge

![Health badge](/badges/mylesduncanking-laravel-simple-migration/health.svg)

```
[![Health](https://phpackages.com/badges/mylesduncanking-laravel-simple-migration/health.svg)](https://phpackages.com/packages/mylesduncanking-laravel-simple-migration)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
