PHPackages                             jslmariano/basic-authentication-otp - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jslmariano/basic-authentication-otp

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jslmariano/basic-authentication-otp
===================================

Laravel OTP code features with sms via nexmo

1.0.0(5y ago)00MITPHPPHP &gt;=7.0

Since Sep 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jslmariano/basic-authentication-otp)[ Packagist](https://packagist.org/packages/jslmariano/basic-authentication-otp)[ RSS](/packages/jslmariano-basic-authentication-otp/feed)WikiDiscussions master Synced 1mo ago

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

Jslmariano Authentication OTP
=============================

[](#jslmariano-authentication-otp)

[![Total Downloads](https://camo.githubusercontent.com/6019a881dae1f6b4138b63fbe7400c803964c8d0c801ffc37f80251606bc2954/68747470733a2f2f706f7365722e707567782e6f72672f6a736c6d617269616e6f2f62617369632d61757468656e7469636174696f6e2d6c6f672f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/jslmariano/basic-authentication-log)[![GitHub license](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://raw.githubusercontent.com/jslmariano/basic-authentication-log/master/LICENSE)

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

[](#installation)

> Laravel Authentication Log requires Laravel 5.5 or higher, and PHP 7.0+.

You may use Composer to install Laravel Authentication Log into your Laravel project:

```
composer require jslmariano/basic-authentication-otp

```

### Configuration

[](#configuration)

After installing the Laravel Authentication Log, publish its config, migration and view, using the `vendor:publish` Artisan command:

```
php artisan vendor:publish --provider="Jslmariano\AuthenticationOtp\Providers\OtpServiceProvider"

```

Next, you need to migrate your database. The Laravel Authentication Log migration will create the table your application needs to store authentication logs:

```
php artisan migrate

```

Then, integrate the `Services\Auth\OTP` to your user login route (by default, `App\Http\Controllers\Auth\AuthController` controller, but please look on your routes as guide to your login controller). This service provides a method to block the authentication process and ensure that it needs the OTP code verified first. You should include this in your login logic before the creation of session or auth token.

```
namespace App\Http\Controllers\Auth;

use Jslmariano\AuthenticationOtp\Services\Auth\OTP as OTPService;

class AuthController extends Controller
{
    ...

    public function login(Request $request)
    {
        ...

        /**
         * OTP FEATURE
         */
        $otp_service = new OTPService();
        if ($otp_service->resolveUser($credentials)->isUserNeedsOTP($request)) {
            $otp_service->processOtp($request);
            return $otp_service->getResponse();
        }
        /**
         * OTP FEATURE END
         * This is to avoid generation of token
         */

        ...
        /* Should be before this code below  */
        /* Code below may vary depending on how you authenticate your users  */

        if (!$token = JWTAuth::attempt($credentials)) {
            return response([
                'status' => 'error',
                'error' => 'invalid.credentials',
                'msg' => 'Invalid Credentials.',
            ], 400);
        }

        Auth::loginUsingId(Auth::User()->id);

    ...
}
```

For the vuejs frontend you need install [@bachdgvn/vue-otp-input](https://www.npmjs.com/package/@bachdgvn/vue-otp-input) first:

```
npm install --save @bachdgvn/vue-otp-input

```

Finally, add the OTP POP-UP as vue component to your vue login. ( Code may also vary depending on how you handle your user login in frontend )

```

       ...

            Log In

       ...

import AuthOtpInput from '../../components/auth/login/otp.vue';

export default {
  components: {
    'auth-login-otp' : AuthOtpInput,
  },

  ...

  methods: {
    otp_check() {
      this.$validator.validate().then(result => {
        if (!result) {
          return false;
        }
        this.$refs.authLoginOtp.check();
      });
    },
    ...
}

...

```

Contributing
------------

[](#contributing)

Thank you for considering contributing to the Laravel Authentication OTP.

License
-------

[](#license)

Laravel Authentication Log is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2054d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9111b7026dace950e8403c8345d96fb4689b4ad630ee0f49df5b2f08acde213?d=identicon)[jslmariano](/maintainers/jslmariano)

---

Top Contributors

[![jslmariano](https://avatars.githubusercontent.com/u/20830165?v=4)](https://github.com/jslmariano "jslmariano (5 commits)")

---

Tags

laravelotpAuthenticationnotification

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jslmariano-basic-authentication-otp/health.svg)

```
[![Health](https://phpackages.com/badges/jslmariano-basic-authentication-otp/health.svg)](https://phpackages.com/packages/jslmariano-basic-authentication-otp)
```

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M347](/packages/tymon-jwt-auth)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M531](/packages/laravel-passport)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)

PHPackages © 2026

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