Laravel 5.8 Eloquent Create() return 错误的Id

Laravel 5.8 Eloquent Create() return wrong Id

public function up() {
        Schema::create( 'active_stocks', function ( Blueprint $table ) {
            $table->bigIncrements( 'id' );
            $table->string( 'sku' );
            $table->text( 'title' )->nullable()->default( '' );
            $table->integer( 'cost' )->default(0);
            $table->integer( 'qty' )->default(0);
            $table->string( 'stock_tracking' )->default('')->nullable();
            $table->integer( 'type' )->default(1);
            $table->text( 'image' )->nullable();
            $table->integer( 'user_id' );
            $table->integer( 'status' )->default(1);
            $table->timestamps();
        } );
        \Illuminate\Support\Facades\DB::statement( "ALTER TABLE `active_stocks` AUTO_INCREMENT = 9999999999;" );
    }

我已经将自动增量设置为我在开发中想要的一些值。 然后我使用 Laravel Eloquent

创建一条新记录
$create = App/ActiveStock::create(
 [
    'sku'            => $item_array['sku'],
    'qty'            => $item_array['qty'],
    'stock_tracking' => $item_array['tracking'],
    'type'           => ActiveStock::TYPE_IMPORTED,
    'cost'           => $item_array['cost'],
    'user_id'        => $user_id,
 ]
)

echo $create->id; //Should be 9999999999

但我得到了这个 2147483647 但是我查看了数据库,id 值是 9999999999 这是正确的。

我在这里遗漏了什么。

这是 $create

的完整响应
App\ActiveStock Object
(
    [fillable:protected] => Array
        (
            [0] => sku
            [1] => title
            [2] => cost
            [3] => qty
            [4] => stock_tracking
            [5] => type
            [6] => image
            [7] => user_id
            [8] => status
        )

    [connection:protected] => mysql
    [table:protected] => active_stocks
    [primaryKey:protected] => id
    [keyType:protected] => int
    [incrementing] => 1
    [with:protected] => Array
        (
        )

    [withCount:protected] => Array
        (
        )

    [perPage:protected] => 15
    [exists] => 1
    [wasRecentlyCreated] => 1
    [attributes:protected] => Array
        (
            [sku] => test-B00MSOIUOO
            [qty] => 11
            [stock_tracking] => 
            [type] => 1
            [cost] => 112
            [user_id] => 1
            [updated_at] => 2020-02-08 17:12:38
            [created_at] => 2020-02-08 17:12:38
            [id] => 2147483647
        )

    [original:protected] => Array
        (
            [sku] => test-B00MSOIUOO
            [qty] => 11
            [stock_tracking] => 
            [type] => 1
            [cost] => 112
            [user_id] => 1
            [updated_at] => 2020-02-08 17:12:38
            [created_at] => 2020-02-08 17:12:38
            [id] => 2147483647
        )

    [changes:protected] => Array
        (
        )

    [casts:protected] => Array
        (
        )

    [dates:protected] => Array
        (
        )

    [dateFormat:protected] => 
    [appends:protected] => Array
        (
        )

    [dispatchesEvents:protected] => Array
        (
        )

    [observables:protected] => Array
        (
        )

    [relations:protected] => Array
        (
        )

    [touches:protected] => Array
        (
        )

    [timestamps] => 1
    [hidden:protected] => Array
        (
        )

    [visible:protected] => Array
        (
        )

    [guarded:protected] => Array
        (
            [0] => *
        )

)

2147483647 是 32 位有符号整数的最大值。 您可能正在使用 PHP.

的 32 位版本

您访问的号码太大。 214748364732-bit int 的最大限制。
如果要存储和使用大于此的数字,您可能需要将列类型从 int 更改为 varchar(100).