我似乎無法找出爲什麼我在這個遷移文件收到此錯誤?Laravel遷移錯誤
錯誤
[37;41米[Symfony的\元器件\調試\異常\ FatalThrowableError]←[39;49米 ←[37;41米調用一個成員函數可爲空的()上的空←[39 ; 49m
該文件的日期是在Customers表中創建外部id後。這是laravel 5.3。我該如何解決這個錯誤?
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('customer_id')->unsigned();
$table->timestamps('date_from')->nullable();
$table->timestamps('date_to')->nullable();
$table->date('invoice_date')->nullable();
$table->date('due_at')->nullable();
$table->integer('total_charge')->nullable();
$table->integer('rate')->nullable();
$table->integer('total_hours')->nullable();
$table->string('status')->nullable();
$table->string('description', 255)->nullable();
$table->string('notes', 255)->nullable();
$table->string('invoice_ref')->nullable();
$table->foreign('customer_id')
->references('id')->on('customers')
->onDelete('cascade');
});
}