PHP code example of kosa3 / migration-stub-extention
1. Go to this page and download the library: Download kosa3/migration-stub-extention library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kosa3 / migration-stub-extention example snippets
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);
});
}
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');
}
}