tomzx / laravel-migration
A migration service based on Laravel Database package.
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 3
pkg:composer/tomzx/laravel-migration
Requires
- php: >=5.4.0
- illuminate/config: ~4.2|~5.0
- illuminate/console: ~4.2|~5.0
- illuminate/database: ~4.2|~5.0
- illuminate/events: ~4.2|~5.0
- illuminate/filesystem: ~4.2|~5.0
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~4
This package is auto-updated.
Last update: 2025-10-10 09:33:14 UTC
README
This is a small package that builds on Laravel's wonderful database package. It extracts the database migration feature in order to use it in any project that may not be built on Laravel.
Note
This is currently a proof of concept. There are rough edges (such as the configuration file and migrations folder location). Those should be fixed given enough time and feedback. Feel free to submit a PR if you have a suggestion on how to deal with those!
This project currently uses some from of "hack" by creating some files in the Illuminate/Foundation namespace. It is expected you will not use this project within the context of a Laravel application, otherwise conflicts will occur.
Getting Started
Laravel 4
Due to technical constraints, the folder structure in Laravel 4 has to be a certain way (specifically, we need a database/migrations path). You can follow Laravel 5 instructions on how to get started, simply make sure that you create the database/migrations path (instead of simply migrations).
your-project
- database
-- database.php
-- database
--- migrations
---- 2015_11_17_215411_some_migration.php
- vendor
-- tomzx
--- LaravelMigration
Laravel 5
The current implementation looks in the current working directory for a configuration file database.php and migration files in the migrations directory.
your-project
- database
-- database.php
-- migrations
--- 2015_11_17_215411_some_migration.php
- vendor
-- tomzx
--- LaravelMigration
To use the tool, you would call laravel-migration within the database directory in the following way:
php ../vendor/bin/laravel-migration
Thus, the current setup steps are:
- Create a
databasedirectory where you will store yourdatabase.phpandmigrationsfiles - Copy
database.phpto your newly created directory and configure it to your needs - Create a
migrationsdirectory in the newly created directory - You may now enjoy
laravel-migration!
License
The code is licensed under the MIT license. See LICENSE.