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
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