lundi 5 juin 2017

Call to undefined method Illuminate\Auth\GenericUser::fill() :: when update

I want to update user password

This is my function

public function modifiermdp(Request $request)
{
    $userupdate = Auth::user();
    $password = bcrypt($request['password']);
    $userupdate->fill(['password' => $password])->save();
    return Redirect::back()->with('message', 'تم التعديل بنجاح');
    }

This is my route

Route::prefix('/compte')->group(function() {
    Route::get('/', 'CompteController@index');
    Route::post('/changemdp', 'CompteController@modifiermdp');
});

And I'm using database driver in config/auth.php

` 'providers' => [

     'enseignant' => [
         'driver' => 'database',
         'table' => 'enseignant',
     ],

],

`

I get this error

FatalErrorException in CompteController.php line 38: Call to undefined method Illuminate\Auth\GenericUser::fill()



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire