PHPackages                             m.rahimi/laravel-tokenize-auth - 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. m.rahimi/laravel-tokenize-auth

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

m.rahimi/laravel-tokenize-auth
==============================

Generate token for authentication.

v1.0.0(4y ago)16MITPHPPHP ^7.1.3|7.2.\*|7.3.\*|7.4.\*|8.\*

Since May 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Mohammadreza-73/Tokenized-auth)[ Packagist](https://packagist.org/packages/m.rahimi/laravel-tokenize-auth)[ Docs](https://github.com/Mohammadreza-73/Tokenized-auth)[ RSS](/packages/mrahimi-laravel-tokenize-auth/feed)WikiDiscussions master Synced today

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

Tokenized-auth
==============

[](#tokenized-auth)

[![Latest Stable Version](https://camo.githubusercontent.com/b4681b5a7961b2b10d34615a0af0f85875a9542f8712c7607286cd8123afeac0/687474703a2f2f706f7365722e707567782e6f72672f6d2e726168696d692f6c61726176656c2d746f6b656e697a652d617574682f76)](https://packagist.org/packages/m.rahimi/laravel-tokenize-auth)[![Total Downloads](https://camo.githubusercontent.com/4adcc2a533edfb5996cc429fbdc16d883118b171a1f6414f5b028b5a7c4113ac/687474703a2f2f706f7365722e707567782e6f72672f6d2e726168696d692f6c61726176656c2d746f6b656e697a652d617574682f646f776e6c6f616473)](https://packagist.org/packages/m.rahimi/laravel-tokenize-auth)[![License](https://camo.githubusercontent.com/a0f6c34be10add8961548566ce42df4857cb11fb7d1cea6b9a5a85075e7ffd81/687474703a2f2f706f7365722e707567782e6f72672f6d2e726168696d692f6c61726176656c2d746f6b656e697a652d617574682f6c6963656e7365)](https://packagist.org/packages/m.rahimi/laravel-tokenize-auth)

This package creates a 6 digits token, which allows you to send it by SMS, email, etc to users and they can login into their account with that token by sending it to specific endpoint.

Tokens are auto expiring and single use.

⬇ Installation:
---------------

[](#-installation)

```
composer require m.rahimi/laravel-tokenize-auth

```

Then publish the config file:

```
php artisan vendor:publish

```

Basic usage:
------------

[](#basic-usage)

Basically, this package introduces 2 endpoints, which you can send requests to them.

1. Generate and send the token to the user

```
POST '/tokenized-login/request-token?email=foo@example.com'
```

2. Accepts the token and authoenticates the user if the token was valid.

```
POST '/tokenized-login/login?email=foo@example.com'
```

Note: If you want to use another shape of urls, just disable default routes in config file `'use_default_routes' => false,` and define your routes.

Customization:
--------------

[](#customization)

You are free to customize and swap the default classes, with your own classes.

If you want to swap the default implementations behind the facades with your own, you can do it within the `boot` method of any service provider class like this :

```
    /**
     * The life time of tokens in seconds.
     */
    'token_ttl' => 120,

    /**
     * Determine if you are ok with using the routes
     * defined within the package or you want to define them
     */
    'use_default_routes' => true,

    /**
     * The rules to validate the the receiver address.
     * Whether email or phone number.
     */
    'address_validation_rules' => ['required', 'email'],

    /**
     * Specify the middlewares to be applied on
     * the routes, which the package has provided for you.
     */
    'route_middlewares' => ['api'],

    /**
     * Define a prefix for the urls to avoid conflicts.
     * Note: the prefix should NOT end in a slash / character.
     */
    'route_prefix_url' => '/tokenized-login',

    /**
     * Notification class used to send the token.
     * You may define your own token sender class.
     */
    'token_sender' => \TokenizedLogin\TokenSenders\TokenSender::class,

    /**
     * You can change the way you generate the token by define you own class.
     */
    'token_generator' => \TokenizedLogin\TokenGenerators\TokenGenerator::class,

    /**
     * You can extend Responses class and override
     * it's methods, to define your own responses.
     */
    'responses' => \TokenizedLogin\Http\Responses\Responses::class,

    /**
     * You can change the way you fetch the user from your database
     * by defining a custom user provider class, and set it here.
     */
    'user_provider' => \TokenizedLogin\UserProvider::class,

    /**
     * You may provide a middleware throttler to throttle
     * the requesting and submission of the tokens.
     */
    'throttler_middleware' => 'throttle:3,1',
];
```

Testing:
--------

[](#testing)

```
composer test

```

🙋 Contributing
--------------

[](#raising_hand-contributing)

If you find an issue, or have a better way to do something, feel free to open an issue or a pull request.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~623 days

Total

2

Last Release

895d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35e4e58889833b695c2c5b4e4c26be535803d06474a69e939de919a298f9f59f?d=identicon)[Rahimi](/maintainers/Rahimi)

---

Top Contributors

[![Mohammadreza-73](https://avatars.githubusercontent.com/u/22294125?v=4)](https://github.com/Mohammadreza-73 "Mohammadreza-73 (18 commits)")

---

Tags

2falaravel-authenticationtokenize-logintwo-factor-authenticationphplaravellaravel-packagepasswordless-authtokenized-login

### Embed Badge

![Health badge](/badges/mrahimi-laravel-tokenize-auth/health.svg)

```
[![Health](https://phpackages.com/badges/mrahimi-laravel-tokenize-auth/health.svg)](https://phpackages.com/packages/mrahimi-laravel-tokenize-auth)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k18.6M62](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.8M47](/packages/santigarcor-laratrust)[imanghafoori/laravel-password-history

A package to keep a history of all password changes of users

70221.8k2](/packages/imanghafoori-laravel-password-history)[imanghafoori/laravel-tokenize-login

Helps you generate and send a random token to have passwordless login.

83236.1k](/packages/imanghafoori-laravel-tokenize-login)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k8](/packages/jeremy379-laravel-openid-connect)

PHPackages © 2026

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