How to disable Laravel eloquent Auto Increment?
if you wish to use a non-incrementing or a non-numeric primary key
you must set the public $incrementing property
on your model to false
.
eg :
class UserVerification extends Model
{
protected $primaryKey = 'your_key_name'; // or null
public $incrementing = false;
}
in case of migration :
$table->integer('id')->unsigned(); // to remove primary key
$table->primary('id'); //to add primary key
refer : https://laravel.com/docs/5.3/eloquent#eloquent-model-conventions
Try public $incrementing = false;