You just change the array keys in Auth::attempt(), though I don't know if you can change the password field.
If I understand you right, you might be able to use an accessor in your User.php model:
public function getNameAttribute()
{
return $this->attributes['your_custom_name_field'];
}
theotherbenjohnson said:
If I understand you right, you might be able to use an accessor in your User.php model:
public function getNameAttribute() { return $this->attributes['your_custom_name_field']; }
That won't work, since the Eloquent auth driver checks the DB for the user based on the array key in attempt.
In your user model, change the getAuthPassword function to return "$this->Password". And in your Auth::attempt() code, you'll still need to specify the password field as 'password' with a lowercase "p". That should work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community