Eloquent 默认是定义整数id 自增为表的主键,但是如果我需要2个段或者更多的时候。需要在对应的model里面定义
protected $primaryKey = ['字段 1','字段2', '字段..'];
public $incrementing = false;
如果自定义第一个,那么会到的 一个 错误为:Illegal offset type
Eloquent 默认是定义整数id 自增为表的主键,但是如果我需要2个段或者更多的时候。需要在对应的model里面定义
protected $primaryKey = ['字段 1','字段2', '字段..'];
public $incrementing = false;
如果自定义第一个,那么会到的 一个 错误为:Illegal offset type