PHPackages                             abelorosz/twostep - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. abelorosz/twostep

ActiveLibrary

abelorosz/twostep
=================

Two-step verification library with support for Laravel 4 integration

v1.0.1(12y ago)109033[1 PRs](https://github.com/abelorosz/twostep/pulls)MITPHPPHP &gt;=5.3.0

Since Feb 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/abelorosz/twostep)[ Packagist](https://packagist.org/packages/abelorosz/twostep)[ Docs](https://abelorosz.github.io/twostep/)[ RSS](/packages/abelorosz-twostep/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Two-step verification
=====================

[](#two-step-verification)

Twostep is a **PHP version of Google's two-step authentication** library. The package includes ServiceProviders and Facades for easy **Laravel 4** integration.

[![Build Status](https://camo.githubusercontent.com/c1e07e750d09b5f813889bf322200ed80f29e9e62dc1cb0b4327d0d95fb8ba73/68747470733a2f2f7472617669732d63692e6f72672f6162656c6f726f737a2f74776f737465702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/abelorosz/twostep)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4

Usage
-----

[](#usage)

- Use `Twostep::generateSecret()` for generating the secret key
- Use `Twostep::checkCode(code, secret)` for checking the code
- Use `Twostep::getUrl(user, hostname, secret)` for generating the QR code url
- Use `Twostep::getCode(secret, ?time)` for generating a code (for a given time)

Installation
------------

[](#installation)

The best way to install Twostep is quickly and easily with [Composer](http://getcomposer.org).

Twostep is available via [Packagist](https://packagist.org/packages/abelorosz/twostep).

Require the package via Composer in your `composer.json`.

```
"abelorosz/twostep": "dev-master"
```

Run Composer to install or update the new requirement.

```
$ php composer.phar install
```

or

```
$ php composer.phar update
```

Now you are able to require the vendor/autoload.php file to PSR-0 autoload the library.

Laravel 4 Integration
---------------------

[](#laravel-4-integration)

Twostep has optional support for [Laravel 4](http://laravel.com/) and comes with a Service Provider and Facades for easy integration. After you have installed Twostep correctly, just follow the instructions.

Open your Laravel config file `config/app.php` and add the following lines.

In the `$providers` array add the service providers for this package.

```
'Abelorosz\Twostep\TwostepServiceProvider',
```

Add the facade of this package to the `$aliases` array.

```
'Twostep'         => 'Abelorosz\Twostep\Facades\Twostep',
```

Now Twostep will be auto-loaded by Laravel.

License
-------

[](#license)

Twostep is licensed under the [MIT License](http://opensource.org/licenses/MIT).

Copyright (c) 2014 [Abel Orosz](http://abelorosz.com)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62b3a286f10128674a166984a1e0cc99ee0d3605abb1cb33b9c2c4be0c279e4b?d=identicon)[abelorosz](/maintainers/abelorosz)

---

Top Contributors

[![abelorosz](https://avatars.githubusercontent.com/u/620148?v=4)](https://github.com/abelorosz "abelorosz (15 commits)")[![0147500](https://avatars.githubusercontent.com/u/9058573?v=4)](https://github.com/0147500 "0147500 (1 commits)")

---

Tags

laravelverificationtwostep

### Embed Badge

![Health badge](/badges/abelorosz-twostep/health.svg)

```
[![Health](https://phpackages.com/badges/abelorosz-twostep/health.svg)](https://phpackages.com/packages/abelorosz-twostep)
```

###  Alternatives

[rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

3376.7k1](/packages/rinvex-laravel-authy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
