PHPackages                             stia/authid-php - 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. stia/authid-php

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

stia/authid-php
===============

SDK / Plugin to handle Authenticator for Auth ID

1.0.2(1y ago)014PHPPHP ^8.1

Since Feb 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/miqdadyyy/authid-php-sdk)[ Packagist](https://packagist.org/packages/stia/authid-php)[ RSS](/packages/stia-authid-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

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

[](#requirements)

- Laravel 10 or later
- PHP 8.1 or later

Instalation Guide
-----------------

[](#instalation-guide)

#### Install dependency with composer

[](#install-dependency-with-composer)

```
composer require stia/authid-php

```

#### Publish the config file

[](#publish-the-config-file)

```
php artisan vendor:publish --provider="Stia\AuthidPhp\AuthIDServiceProvider"

```

#### Run the migration

[](#run-the-migration)

```
php artisan migrate

```

#### To enable 2 FA, add the following code to the User model

[](#to-enable-2-fa-add-the-following-code-to-the-user-model)

```
use TwoFactorAuthenticatable;
```

Example:

```
class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable;
    use TwoFactorAuthenticatable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
    ...
```

Method Usage
------------

[](#method-usage)

### Check is user already have recovery codes

[](#check-is-user-already-have-recovery-codes)

```
$user = User::find($id);
$isEnabled = $user->hasEnabledTwoFactorAuthentication();

return $isEnabled;
```

### Generate new recovery codes

[](#generate-new-recovery-codes)

```
$user = User::find($id);
$user->generateNewRecoveryCode();
```

### Get user recovery codes

[](#get-user-recovery-codes)

```
$user = User::find($id);
$recoveryCodes = $user->recoveryCodes();

return $recoveryCodes;
```

### Enable 2FA and generate QR code

[](#enable-2fa-and-generate-qr-code)

```
namespace App\Http\Controllers;

use Stia\AuthidPhp\Actions\EnableTwoFactorAuthentication;

class UserController extends Controller
{
    public function enableTwoFactorAuthentication(EnableTwoFactorAuthentication $enableAction)
    {
        $user = auth()->user();
        $enableAction($user);
        return $user->twoFactorQrCodeSvg();
    }
}
```

### Validate 2FA

[](#validate-2fa)

```
namespace App\Http\Controllers;

use Illuminate\Support\Facades\Request;
use Stia\AuthidPhp\Actions\EnableTwoFactorAuthentication;
use Stia\AuthidPhp\Actions\IsTwoFactorAuthenticationValid;

class UserController extends Controller
{
    public function validateTwoFactorAuthentication(Request $request, IsTwoFactorAuthenticationValid $confirm)
    {
        if ($confirm($request->user(), $request->code)) {
            return 'OK';
        }

        return 'Code not valid';
    }

...
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance45

Moderate activity, may be stable

Popularity6

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

Every ~9 days

Total

3

Last Release

434d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/033c2a26a169ad9065e9ebc31fb2af0eebefdd530f06af8b74039bf5e3d209b3?d=identicon)[miqdadyyy](/maintainers/miqdadyyy)

---

Top Contributors

[![miqdadyyy](https://avatars.githubusercontent.com/u/34906923?v=4)](https://github.com/miqdadyyy "miqdadyyy (6 commits)")

### Embed Badge

![Health badge](/badges/stia-authid-php/health.svg)

```
[![Health](https://phpackages.com/badges/stia-authid-php/health.svg)](https://phpackages.com/packages/stia-authid-php)
```

###  Alternatives

[laravel/fortify

Backend controllers and scaffolding for Laravel authentication.

1.7k41.4M245](/packages/laravel-fortify)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[devdojo/auth

The auth package to make authentication in your laravel applications easy to use.

61979.4k2](/packages/devdojo-auth)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

81158.7k4](/packages/stephenjude-filament-two-factor-authentication)

PHPackages © 2026

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