그냥 사는 이야기

Laravel 5.3 Tutorial for Beginner - Social Network (CRUD) Migrations 본문

Development/Web

Laravel 5.3 Tutorial for Beginner - Social Network (CRUD) Migrations

없다캐라 2020. 1. 19. 04:41
반응형

Posts

php artisan make:migration create_posts_table --create=posts
database/migrations/create_posts_table.php
public function up()
{
  Schema::create('posts', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('user_id'); // added
    $table->text('content');    // added
    $table->timestamps();
  });
}

Migration

php artisan migrate
Comments