当前位置:网站首页>Laravel admin obtains non auto increment ID and submits hidden forms

Laravel admin obtains non auto increment ID and submits hidden forms

2022-06-26 11:06:00 siner. li

stay laravel Get non auto increment in ID

Model Of $incrementing The default is true

When we use non self augmentation ID when , Will be used by default int

Add... To the model

public $incrementing = false;

The problem is solved


Non integer primary key , Need to add

protected $keyType = 'string';

Submit hidden form

	//  Set hidden fields 
	$form->ignore(['title']);

	$form->saving(function () {
    
		//  Get all form information 
        $date = request()->all();
        dd($date);
    });
原网站

版权声明
本文为[siner. li]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261004262293.html