Code snippet that can be used to Indicates if the IDs are auto incrementing in Laravel
Eloquent assumes that the primary key is an incrementing integer value, which means that by default the primary key will automatically be cast to an int
. 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
:
<?php
class Flight extends Model
{
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
}