Sorry, I really didn't want to attack Laravel and get in an argument with you. I'm evaluating it.
No argument - just trying to understand what your expectations are and make sure you understand what Laravel is capable of.
But my approach to this issue would be: either I don't provide an authentication mechanism or I provide a good one. Nothing in between. Why can I change the name of the table name and the user but can't change the email field?
The problem is with the way Eloquent models work - the column names are implicitly linked to the property names of the model, so $model->email expects to find the data in the email column.
However, there is an alternative - Eloquent models allow you to provide
accessors and mutators for the various fields (user, email, password, remember_token, etc) such that when you request the "email" from the model, it actually retrieves the value from the column names you define.
For example ...
PHP:
class User extends Model {
public function getEmailAttribute()
{
return $this->email_address;
}
public function setEmailAttribute($value)
{
$this->attributes['email_address'] = $value;
}
}
Then $model->email will actually be returning the value of the column 'email_address' rather than 'email'.
There is some magic behind the Eloquent model class which makes this possible - have a close look at the Model class to understand more about how it works under the covers - it really is quite powerful.
Personally I don't like this approach though and would rather write my own clean user model code to start with to make it much more obvious what is happening (less magic).
Also, don't forget that Eloquent isn't the only way to do this. Personally, I prefer using Doctrine for my ORM which doesn't have these problems because you can configure the table and column names directly in the model annotations.