<?php

return array(

	/*
	|--------------------------------------------------------------------------
	| Authentication Model
	|--------------------------------------------------------------------------
	|
	| This model will be used by the Auth class when retrieving the users of
	| your application. Feel free to change it to the name of your user model.
	|
	| Note: The authentication model must be an Eloquent model.
	|
	*/

	'model' => 'User',

	/*
	|--------------------------------------------------------------------------
	| Authentication Username
	|--------------------------------------------------------------------------
	|
	| The authentication username is the column on your users table that
	| is considered the username of the user. Typically, this is either "email"
	| or "username". However, you are free to make it whatever you wish.
	|
	*/

	'username' => 'email',

);
<?php

return array(

	/*
	|--------------------------------------------------------------------------
	| Retrieve Users By ID
	|--------------------------------------------------------------------------
	|
	| This method is called by the Auth::user() method when attempting to load
	| a user by their user ID. 
	|
	| You are free to change this method for your application however you wish.
	|
	*/

	'by_id' => function($id)
	{
		return User::find($id);
	},

	/*
	|--------------------------------------------------------------------------
	| Retrieve Users By Username
	|--------------------------------------------------------------------------
	|
	| This method is called by the Auth::check() method when attempting to load
	| a user by their username. 
	|
	| You are free to change this method for your application however you wish,
	| as long as you return an object that has "id" and "password" properties.
	|
	*/

	'by_username' => function($username)
	{
		return User::where('email', '=', $username)->first();
	},

);
Refactor Auth config to use closures.
Refactor Auth config to use closures.