auth.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. return array(
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Retrieve Users By ID
  6. |--------------------------------------------------------------------------
  7. |
  8. | This method is called by the Auth::user() method when attempting to load
  9. | a user by their user ID.
  10. |
  11. | You are free to change this method for your application however you wish.
  12. |
  13. */
  14. 'by_id' => function($id)
  15. {
  16. return User::find($id);
  17. },
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Retrieve Users By Username
  21. |--------------------------------------------------------------------------
  22. |
  23. | This method is called by the Auth::check() method when attempting to load
  24. | a user by their username.
  25. |
  26. | You are free to change this method for your application however you wish,
  27. | as long as you return an object that has "id" and "password" properties.
  28. |
  29. */
  30. 'by_username' => function($username)
  31. {
  32. return User::where('email', '=', $username)->first();
  33. },
  34. );