Schema

// Indicate that the table needs to be created
 Schema::create('table', function($table)
{
  $table->increments('id');
});
// Specify a Connection
 Schema::connection('foo')->create('table', function($table){});
// Rename the table to a given name
 Schema::rename($from, $to);
// Indicate that the table should be dropped
 Schema::drop('table');
// Indicate that the table should be dropped if it exists
 Schema::dropIfExists('table');
// Determine if the given table exists
 Schema::hasTable('table');
// Determine if the given table has a given column
 Schema::hasColumn('table', 'column');
// Update an existing table
 Schema::table('table', function($table){});
// Indicate that the given columns should be renamed
$table->renameColumn('from', 'to');
// Indicate that the given columns should be dropped
$table->dropColumn(string|array);
// The storage engine that should be used for the table
$table->engine = 'InnoDB';
// Only work on MySQL
$table->string('name')->after('email');

Last updated