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

42 lines
1.1 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:45:04 -07:00
| This method is called by the Auth::user() method when attempting to
| retrieve 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:45:04 -07:00
| This method is called by the Auth::check() method when attempting to
| retrieve a user by their username.
2011-07-11 12:41:50 -07:00
|
2011-07-11 12:45:04 -07:00
| You are free to change this method for your application however you wish.
|
| Note: This method must return an object that has an "id" and a "password"
| property. The type of object returned doesn't matter.
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
);