laravel5.2.9 - Laravel5.2 changed users to user, but an error was reported. What else needs to be changed? I really can't get used to plural numbers
迷茫
迷茫 2017-05-16 16:52:13
0
1
462

I couldn’t get used to laravel’s plural table names, so I changed users to user.

is also defined in Model
protected $table = 'user';

But an error is still reported.
As long as it is from $request->user(), the users table will not exist. What is the situation? Solve

Figure 2 is the configuration in config/auth
Figure 3 is the user model

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
为情所困

Please see the error reporting part:

If the error occurs in UserRegisterRequest 中進行 validate 的時候,因為你其中一個 rule
'email' => 'unique:users,email' ,這會導致其去檢查 users 這個 table 裡面的 email 字段是否有重複(唯一性),所以你應該改成 'email' => 'unique:user,email' then it’s ok

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template