kosa3 / migration-stub-extention
1.0.3
2019-12-04 04:40 UTC
Requires
- php: ^7.0
- laravel/framework: ^5.5
This package is not auto-updated.
Last update: 2025-06-24 14:29:15 UTC
README
Install
Require this package with composer using the following command:
composer require --dev kosa3/migration-stub-extention:dev-master
After updating composer, add the migration directory to the resources
stubs blank.stub
create.stub
update.stub
You can customize the stub file freely.
public function up() { Schema::create('DummyTable', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamp('created_at')->nullable(); $table->string('create_type', 32)->nullable()->default(null); $table->integer('create_id')->nullable()->default(null); $table->timestamp('updated_at')->nullable(); $table->string('update_type', 32)->nullable()->default(null); $table->integer('update_id')->nullable()->default(null); }); }
After edited, make migration file by artisan command.
php artisan make:migration CreateUser --create users
class CreateUser extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamp('created_at')->nullable(); $table->string('create_type', 32)->nullable()->default(null); $table->integer('create_id')->nullable()->default(null); $table->timestamp('updated_at')->nullable(); $table->string('update_type', 32)->nullable()->default(null); $table->integer('update_id')->nullable()->default(null); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }
License
The package is open-source software licensed under the MIT license.