【发布时间】:2017-11-06 10:55:44
【问题描述】:
我要更新用户密码
这是我的功能:
public function modifiermdp(Request $request)
{
$userupdate = Auth::user();
$password = bcrypt($request['password']);
$userupdate->fill(['password' => $password])->save();
return Redirect::back()->with('message', 'تم التعديل بنجاح');
}
这是我的路线:
Route::prefix('/compte')->group(function() {
Route::get('/', 'CompteController@index');
Route::post('/changemdp', 'CompteController@modifiermdp');
});
我在 config/auth.php 中使用数据库驱动程序
'providers' => [
'enseignant' => [
'driver' => 'database',
'table' => 'enseignant',
],
],
我收到这个错误
CompteController.php 第 38 行中的 FatalErrorException: 调用未定义的方法 Illuminate\Auth\GenericUser::fill()
【问题讨论】:
标签: php database laravel laravel-5