I\'m currently working on my first laravel project and i\'m facing a problem.
If you have experience with laravel you probably know that by calling php artisan
In Laravel 5.7 beside above answer you must change EloquentUserProvider class. search in the file for 'password' word in lines (107,117, and 140) you found 'password' word and change it with new name, and this is all solustion.
public function getAuthPassword(){ return $this->new_password_name; }
protected function validateLogin(Request $request){ $this->validate($request, [ $this->username() => 'required', 'new_password_name' => 'required', ]); } protected function credentials(Request $request) { return $request->only($this->username(), 'new_password_name'); } public function username() { return 'new_username';//or new email name if you changed }
validateCredentials
and retrieveByCredentials
function change 'password' word with the new name.Edit :I change EloquentUserProvider
class but if you think changing laravel class is a bad practice you can create custom provider and override the retrieveByCredentials
and validateCredentials
functions in the custom provider.