When the primary key of the data table is renamed, such as uid, the multi-table query in laravel's ORM cannot be executed.
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 16:51:39
0
1
495

1. For example, User::find(1)->hasOneMachine; will report an error because the primary key of the User table is uid instead of id

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
phpcn_u1582

User.php

protected $primaryKey = 'uid';
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template