Files
spa-api/application/config/auth.php

40 lines
1.0 KiB
PHP
Raw Normal View History

2011-06-08 23:45:08 -05:00
<?php
return array(
/*
|--------------------------------------------------------------------------
2011-07-11 12:41:50 -07:00
| Retrieve Users By ID
2011-06-08 23:45:08 -05:00
|--------------------------------------------------------------------------
|
2011-07-11 12:41:50 -07:00
| This method is called by the Auth::user() method when attempting to load
| a user by their user ID.
2011-06-08 23:45:08 -05:00
|
2011-07-11 12:41:50 -07:00
| You are free to change this method for your application however you wish.
2011-06-08 23:45:08 -05:00
|
*/
2011-07-11 12:41:50 -07:00
'by_id' => function($id)
{
return User::find($id);
},
2011-06-08 23:45:08 -05:00
/*
|--------------------------------------------------------------------------
2011-07-11 12:41:50 -07:00
| Retrieve Users By Username
2011-06-08 23:45:08 -05:00
|--------------------------------------------------------------------------
|
2011-07-11 12:41:50 -07:00
| 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.
2011-06-08 23:45:08 -05:00
|
*/
2011-07-11 12:41:50 -07:00
'by_username' => function($username)
{
return User::where('email', '=', $username)->first();
},
2011-06-08 23:45:08 -05:00
);