この移行ファイルでこのエラーが発生する理由がわかりません。Laravel Migration Error
エラー
[37; 41メートル[symfonyの\コンポーネント\デバッグ\例外\ FatalThrowableError]←[39; 49メートル ←[37;メンバ関数NULL可能に41メートル()の呼び出しはnullで←[39 ; 49m
ファイルの日付は、Customersテーブルの外部IDの作成後です。これはlaravel 5.3です。このエラーを解決するにはどうすればよいですか?この2行
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');
});
}