PHPackages                             laikait/laika-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. laikait/laika-auth

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

laikait/laika-auth
==================

Multi-guard authentication package for the Laika PHP MVC Framework with OAuth support

v1.0.0(yesterday)01↑2900%MITPHP &gt;=8.1

Since Jul 19Compare

[ Source](https://github.com/laikait/laika-auth)[ Packagist](https://packagist.org/packages/laikait/laika-auth)[ RSS](/packages/laikait-laika-auth/feed)WikiDiscussions Synced today

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Laika Auth
==========

[](#laika-auth)

Multi-guard authentication package for the Laika PHP MVC Framework.

Features
--------

[](#features)

- Session, Cookie, and Token guards
- Google &amp; Facebook OAuth login
- Browser/IP/token tracking per session (`auth_tokens` table)
- Token issue, validate, revoke, revoke-all
- Config-driven guard and provider resolution

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

[](#installation)

```
composer require laikait/laika-auth
```

Run the migration in `database/migrations` to create the `auth_tokens` and `oauth_accounts` tables.

Configuration
-------------

[](#configuration)

Publish and edit `lf-config/auth.php` to set guards and OAuth credentials.

```
'guards' => [
    'web' => ['driver' => 'session', 'provider' => 'users'],
    'api' => ['driver' => 'token'],
],
'oauth' => [
    'google' => [
        'client_id' => 'GOOGLE_CLIENT_ID',
        'client_secret' => 'GOOGLE_CLIENT_SECRET',
        'user_model' => '\\App\\Models\\User::class',
    ],
],
```

Usage
-----

[](#usage)

### Token guard

[](#token-guard)

```
$auth = new AuthManager($config);
$guard = $auth->guard('api');

$issued = $guard->issueToken($userId);
$user = $guard->validateToken($plainToken);
$guard->revoke($plainToken);
```

### OAuth login

[](#oauth-login)

```
$oauth = $auth->oauth('google');

// Step 1: redirect
header('Location: ' . $oauth->redirect($redirectUri));

// Step 2: callback
$result = $oauth->callback($_GET['code'], $redirectUri);
// $result['user'], $result['token']
```

Database Tables
---------------

[](#database-tables)

- `auth_tokens` — user\_id, guard, browser, ip, user\_agent, token, refresh\_token, expires\_at, revoked\_at
- `oauth_accounts` — user\_id, provider, provider\_user\_id, access\_token, refresh\_token, email, avatar

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7272cd554fe8bf859b8450494f244927ee210cd95d516325fda55d33c74e5886?d=identicon)[riyadhtayf](/maintainers/riyadhtayf)

---

Tags

phpauthAuthenticationoauthlaika

### Embed Badge

![Health badge](/badges/laikait-laika-auth/health.svg)

```
[![Health](https://phpackages.com/badges/laikait-laika-auth/health.svg)](https://phpackages.com/packages/laikait-laika-auth)
```

###  Alternatives

[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

41021.9M94](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.3M3](/packages/auth0-login)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[maicol07/flarum-ext-sso

SSO for Flarum

468.7k](/packages/maicol07-flarum-ext-sso)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

196.8k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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