title: Extending the Schema Builder
body: <p>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.</p>
  
  <p>Thank you kindly.</p>
  
  <p>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?</p>
  
  <p>EDIT: went with the approach as suggested by Gareth Oakley by adding a DB::statement() call after Schema::create():</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
      class CreateExamplesTable extends Migration {
  
          public function up()
          {
              Schema::create('examples', function(Blueprint $table)
              {
                  $table-&gt;engine = 'InnoDB';
  
                  $table-&gt;increments('id')-&gt;unsigned();
                  $table-&gt;integer('account_id')-&gt;unsigned();
                  $table-&gt;string('card_id', 20)-&gt;nullable();
                  $table-&gt;boolean('active')-&gt;default(true);
                  $table-&gt;timestamps();
  
                  $table-&gt;foreign('account_id')-&gt;references('id')-&gt;on('accounts')-&gt;onDelete('cascade')-&gt;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');
          }
      }
  </code></pre>