如何修复"方法Illuminate\Database\Schema\Blueprint::number不



当我使用php手工迁移时,我会收到此消息。有人能帮我吗?我在互联网上搜索了一下,但没有找到任何对我有帮助的东西。(我是laravel的新手(

我的桌子:

<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
class CreateSroomsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('srooms', function (Blueprint $table) {
$table->id();
$table->string('room_two');
$table->string('room_three');
$table->string('room_four');
$table->string('room_five');
$table->string('room_six');
$table->string('room_seven');
$table->string('room_eight');
$table->string('room_nine');
$table->string('room_ten');
$table->string('room_eleven');
$table->string('room_twelve');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('srooms');
}
}`

您将列声明为数字,如:

[$table->number('')] 

但是你应该使用

[$table->integer('')]

最新更新