从用户模型访问confirmation_token的查询结果显示错误

时间:2019-04-09 13:40:28

标签: postman laravel-5.7 laravel-passport

  ""  stcuked with this issue any solution please let me knw...  "" 


public function confirm($token){
               // $user =\DB::table('users')->where('confirmation_token',$token)->firstOrFail(); 
               // $token = User::findorFail($token);
                $user =\DB::table('users')->where('confirmation_token',$token)->firstOrFail();
               // User::where('confirmation_token',$token)->first();
                if (!$user) {
                  return response()->json([
                 'message'=> 'this activation token is invalid'
                ]);
                }
                  $user ->confirmed = User::CONFIRMEDEMAIL_USER;
                  $user->confirmation_token = null;
                  $user->save();
                  return $this->showMessage('the account verified');
                }

如何使用各种可能性解决此问题,并给出相同的错误      “ message”:“没有模型[App \ User]的查询结果。”,         “ exception”:“ Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException”,         “文件”:“ / home / aoudhesh / Downloads / stigitel / vendor / laravel / framework / src / Illuminate / Foundation / Exceptions / Handler.php”,         “行”:200,

0 个答案:

没有答案