Can anybody advise me, in great detail, on how to go about extending Illuminate\Database\Schema so as to add a zerofill function and also modify the current integer function to take a length argument, all while not actually modifying any of the vendor files.
Thank you kindly.
EDIT: or is there a way to add a column manually with the Schema Builder, that I'm just missing cause of my heavy Friday afternoon head?
EDIT: went with the approach as suggested by Gareth Oakley by adding a DB::statement() call after Schema::create():
<?php
class CreateExamplesTable extends Migration {
public function up()
{
Schema::create('examples', function(Blueprint $table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->integer('account_id')->unsigned();
$table->string('card_id', 20)->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade')->onUpdate('cascade');
});
DB::statement('ALTER TABLE examples ADD invoice_id INT(6) UNSIGNED ZEROFILL NOT NULL AFTER card_id');
}
public function down()
{
Schema::drop('examples');
}
}