obarlas/laravel-migrate-custom-command

Creates database migration files from custom templates.
16
Install
composer require obarlas/laravel-migrate-custom-command
Latest Version:v0.1
PHP:>=5.3.0
Last Updated:Jul 10, 2014
Links: GitHub  ·  Packagist
Maintainer: obarlas

laravel-migrate-custom-command

Purpose of this package is to create database migration files from custom templates since custom migration templates are not available in Laravel.

Instead of hard coding table names in the migration class, I prefer to use global variables so I can just copy/paste the same creation and foreign key strings to other migration files easily, also I have default columns on my tables so this prevents me from rewriting every database migration file.

Usage

  • You must add the package to your app config.
'Obarlas\LaravelMigrateCustomCommand\LaravelMigrateCustomCommandServiceProvider',
  • In the src/stubs folder of the package original stubs from the Laravel package can be found, create and copy them to your database/templates folder. Now you can edit the stubs according to your needs.

  • Usage is simple

php artisan migrate:custom stub_name class_name --table=table_name
  • migrate:custom command checks if there is a {{table}} variable in the stub file, and if no --table argument is passed it stops.

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

576,155,700 34,907
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444