Ve vaší CreateUserTable migrační soubor namísto Schema::table musíte použít Schema::create .
Schema::table se používá ke změně existující tabulky a Schema::create se používá k vytvoření nové tabulky.
Zkontrolujte dokumentaci:
- https://laravel.com/docs/schema#creating- and-drop-tables
- https://laravel.com/docs/schema#adding-columns
Vaše migrace uživatelů tedy bude:
<?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");
}
}