我的模型中的主键是uniqid()(带字母的13个字符)。当我$user->id
时,它只显示第一个数字并忘记其他字符。
App\Models\User::__set_state(array(
'connection' => NULL,
'table' => NULL,
'primaryKey' => 'id',
'keyType' => 'int',
'incrementing' => true,
'with' =>
array (
),
'perPage' => 15,
'exists' => true,
'wasRecentlyCreated' => false,
'attributes' =>
array (
'id' => '58acab3993c2e',
'email' => 'admin@admin.fr',
'password' => '$2y$10$nR.2EnKMX/wCnIbN8Wt36.qF0nPnxcxXM/rIG2SxC0vCX8EtwGQg.',
'fname' => 'Foo',
'lname' => 'Bar',
'role' => 0,
'website' => '',
'description' => '',
'phone' => '',
'picture' => 'static/uploads/58acab3993c2e.jpg',
'admin' => 1,
'accepted' => 1,
),
我认为这是因为我的keyType是一个int ...如何更改?我用潇洒的口才。