I couldn’t get used to laravel’s plural table names, so I changed users to user.
is also defined in Modelprotected $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
为情所困2017-05-16 16:54:13
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