Skip to content

Instantly share code, notes, and snippets.

@rohman
Last active December 30, 2015 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohman/7748078 to your computer and use it in GitHub Desktop.
Save rohman/7748078 to your computer and use it in GitHub Desktop.
L4 Blog Migration Create Pages Table
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePagesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pages', function(Blueprint $table)
{
$table->increments('id');
$table->string('title');
$table->string('slug');
$table->text('body')->nullable();
$table->integer('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('pages');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment