2016-03-28 24 views
3

上這是功能更新用戶密碼可以在本地主機更新的用戶密碼,但不共享託管服務器

function update_systemusers_password($input) { 
    $systemusers = users::find($input['userid']); 
    $systemusers->password = bcrypt($input['password']); 
    $systemusers->save(); 
} 

但是它不共享託管服務器更新

+0

它在託管服務器中說什麼?拋出任何錯誤? – ggderas

+0

沒有錯誤信息說成功但密碼不更新 – akash

+0

您需要開始調試! update_systemusers_password()方法是否執行?嘗試在不同點記錄方法中的任意字符串或回顯響應以查看事件出錯的地方。 – Jeemusu

回答

0

首先你需要的確認你的功能是否執行。嘗試這樣的事情來確保。

function update_systemusers_password($input) { 
dd($input); // it will show the all of input 
$systemusers = users::find($input['userid']); 
$systemusers->password = bcrypt($input['password']); 
$systemusers->save(); 
} 

if dd();打印請求的所有值,然後刪除dd();在函數內部寫入一些條件進行確認。

function update_systemusers_password($input) { 
$systemusers = users::find($input['userid']); 
$systemusers->password = bcrypt($input['password']); 
if($systemusers->save()){ 
    dd("save successfully"); 
} 
else{ 
    dd("found error"); 
} 
} 
+0

它在更新自己的密碼時顯示另一個用戶的id。它可以解決。 – akash

相關問題