1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- return array(
-
- 'user' => function($id)
- {
- if (filter_var($id, FILTER_VALIDATE_INT) !== false)
- {
- return DB::table('users')->find($id);
- }
- },
-
- 'attempt' => function($username, $password)
- {
- $user = DB::table('users')->where_username($username)->first();
- if ( ! is_null($user) and Hash::check($password, $user->password))
- {
- return $user;
- }
- },
-
- 'logout' => function($user) {}
- );
|