Laravel 5.3 - QueryException in Connection.php line 761


Laravel 5.3 - QueryException in Connection.php line 761

我一直得到这个错误:

(一般错误:1366)不正确的整数值

每次我试着用下面这些特定的栏来发布我的表单:

public function up()
{
    Schema::table('dossiers', function (Blueprint $table) {             
        $table->integer('amount_of_cilinders')->nullable();         
        $table->integer('amount_of_doors')->nullable();            
        $table->integer('manufacturing_year')->nullable();          
        $table->integer('manufacturing_month')->nullable();
        $table->date('date_first_admission')->nullable();                         
        $table->integer('weight')->nullable();                                            
        $table->integer('power')->nullable();      
    });
}

尽管我将所有列设置为可空,但SQL要求我在输入中填写整数/日期。

这里出了什么问题?

这听起来像是您试图通过表单将非整数值发布到列。我建议检查从表单传递的数据