Last active
December 30, 2015 00:09
-
-
Save rohman/7748045 to your computer and use it in GitHub Desktop.
L4 Blog Migration Create Article Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateArticlesTable extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('articles', function(Blueprint $table) | |
{ | |
$table->increments('id'); | |
$table->string('title'); | |
$table->string('slug'); | |
$table->text('body')->nullable(); | |
$table->string('image')->nullable(); | |
$table->integer('user_id'); | |
$table->timestamps(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::drop('articles'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment