Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 11 class LogAuthenticationAttempt
- 12 {
- 13 /**
- 14 * Create the event listener.
- 15 *
- 16 * @return void
- 17 */
- 18 public function __construct()
- 19 {
- 20 //
- 21 }
- 22
- 23 /**
- 24 * Handle the event.
- 25 *
- 26 * @param Attempting $event
- 27 * @return void
- 28 */
- 29 public function handle(Attempting $event)
- 30 {
- 31 $username = $event->credentials['username'];
- 32 $password = $event->credentials['password'];
- 33 $login_successful = Auth::attempt(["username"=>$username, "password"=>$password]);
- 34 DB::insert('insert into logins(created_at, updated_at, login, ip, success) values (now(), now(), ?, ?, ?)',
- 35 [$username, Request::ip(), $login_successful]);
- 36 }
- 37 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement