Di CreateUserTable
. Anda file migrasi, bukan Schema::table
anda harus menggunakan Schema::create
.
Schema::table
digunakan untuk mengubah tabel yang ada dan Schema::create
digunakan untuk membuat tabel baru.
Periksa dokumentasi:
- http://laravel.com/docs/schema#creating- dan-menjatuhkan-tabel
- http://laravel.com/docs/schema#adding-columns
Jadi migrasi pengguna Anda adalah:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user', function(Blueprint $table) {
{
$table->increments("id",true);
$table->string("username")->nullable()->default(null);
$table->string("password")->nullable()->default(null);
$table->string("email")->nullable()->default(null);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists("user");
}
}