Ich kann nicht herausfinden, warum ich diesen Fehler in dieser Migrationsdatei bekomme?Laravel Migration Fehler
Fehler
[37; 41m [Symfony \ Component \ Debug \ Exception \ FatalThrowableError] ← [39; 49m ← [37; 41m Aufruf an eine Elementfunktion nullable() auf null ← [39 ; 49m
Das Datum in der Datei ist nach der Erstellung der fremden ID in der Customers-Tabelle. Dies ist Laravel 5.3. Wie kann ich diesen Fehler beheben?
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');
});
}