0
我使用php artisan migrate:make
在Laravel中创建了表迁移。当我尝试在数据库中创建表格时,出现错误:ErrorException:从空值创建默认对象
[ErrorException]
Creating default object from empty value
这与此相关的是什么?没有创建表格,也不能在我的迁移中找到任何错误。
我有25个表中的migrations文件夹,所有的外观都与此类似。
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAddressesTable extends Migration {
public function up() {
Schema::create("addresses", function() {
$table->engine = "InnoDB";
$table->increments("id");
$table->integer("user_id")->unsigned();
$table->string("street");
$table->string("city");
$table->integer("postal_code")->unsigned();
$table->foreign("user_id")->references("id")->on("users");
$table->softDeletes();
$table->timestamps();
});
}
public function down() {
Schema::dropIfExists("addresses");
}
}
尼斯渔获物。在这里只有错误的文件,这是25个文件中唯一缺失的文件,谢谢。 – MikkoP