4
我試圖讓消氣& setter方法(在Laravel 4從Laravel 3)工作Laravel 4:getter和setter方法
但顯示錯誤。
有沒有在這裏工作?
他們是非常有用的密碼的情況下:
public function set_password($password)
{
$this->set_attribute('hashed_password', Hash::make($password));
}
http://three.laravel.com/docs/database/eloquent
你是怎麼調用set_password的? –
你沒有,當你用密碼設置新的用戶記錄時,Laravel會爲你調用它,只需在你的模型中放入setPasswordAttribute()(請檢查我的答案) – mwafi