lbadger / illuminate-data-migrations by lbadger

Data Migrations for Laravel
1,499
3
2
Package Data
Maintainer Username: lbadger
Package Create Date: 2017-09-11
Package Last Update: 2019-12-02
Language: PHP
License: Unknown
Last Refreshed: 2025-02-07 15:06:53
Package Statistics
Total Downloads: 1,499
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 1
Total Open Issues: 1

illuminate-data-migrations

Creating data migrations for Laravel. This keeps data out of migrations and leaves it for schema changes only.

Install

composer require lbadger/illuminate-data-migrations

Data Migration Folder

Create a folder called "data_migrations" in the /database folder

Laravel

config/database.php

'data-migrations' => 'data_migrations',

config/app.php

Add these to the 'providers' array

\Lbadger\Database\Providers\ArtisanServiceProvider::class,
\Lbadger\Database\Providers\DataMigrationServiceProvider::class,

Lumen

bootstrap/app.php

$app['config']['database.data-migrations'] = 'data_migrations';
$app->register(\Lbadger\Database\Providers\ArtisanServiceProvider::class);
$app->register(\Lbadger\Database\Providers\DataMigrationServiceProvider::class);

Custom Stub

If you would like to use custom stubs, you need to put your stub in the database/stubs directory with the suffix of .stub
  • Note: You cannot have the same data migration class name as a normal migration