Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dclarke-modus/a66646c9152714d8c911b1fa00fc7878 to your computer and use it in GitHub Desktop.
Save dclarke-modus/a66646c9152714d8c911b1fa00fc7878 to your computer and use it in GitHub Desktop.
Class CustomMigration extends Migration
{
protected function createAuditTables ($table)
{
$table->timestamp('auditCreated_at')->useCurrent = true;
$table->timestamp('auditUpdated_at')->useCurrent = true;
}
}
class 2017_08_12_BlahTable extends CustomMigration
{
public function up()
{
var $me = $this;
Schema::create('Blah', function (Blueprint $table) use ($me) {
$table->increments('id');
$table->int('custom_column');
$me->createAuditTables($table);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment