PHPackages                             code4mk/kauth - 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. code4mk/kauth

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

code4mk/kauth
=============

kauth is JWT API Authentication ( jwt-auth ) for laravel

3.0.1(6y ago)141212MITPHP

Since Feb 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/code4mk/kauth)[ Packagist](https://packagist.org/packages/code4mk/kauth)[ Docs](https://github.com/code4mk/kauth)[ RSS](/packages/code4mk-kauth/feed)WikiDiscussions master Synced 2w ago

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

[![kauth](https://user-images.githubusercontent.com/17185462/52489899-aa8b2500-2bed-11e9-8092-9b44bb827d17.png)](https://user-images.githubusercontent.com/17185462/52489899-aa8b2500-2bed-11e9-8092-9b44bb827d17.png)

`kauth`
=======

[](#kauth)

kauth is JWT API Authentication ( jwt-auth ) for laravel

Installation
============

[](#installation)

you can install kauth package by command

```
composer require code4mk/kauth
```

Setup
=====

[](#setup)

### 1) Vendor publish.

[](#1-vendor-publish)

```
php artisan vendor:publish --provider="Kauth\KauthServiceProvider" --tag=config
php artisan vendor:publish --provider="Kauth\KauthServiceProvider" --tag=migations
```

### 2) Config setup

[](#2-config-setup)

- `config\kauth.php`
- set `token_header_name` that you can use with guzzle or axios header
- default `token_header_name` name is `tokon`

Usage
=====

[](#usage)

`Kauth::attempt()` functions
----------------------------

[](#kauthattempt-functions)

- guard('name')

```
// guard name will be user table name
Kauth::guard("users")
```

- socialite()-&gt;attempt()

```
// laravel socialite system
// credential will be only email
Kauth::guard("users")->socialite()
        ->attempt(["email"=>"ex@gmail.com"]);
```

- normal attempt()

```
// your all desired credentials
// password credentail need
Kauth::guard("users")
  ->attempt(["email"=>"ex@email.com","password"=>1234])
```

~ `attempt() return a jwt token` which you pass with request header (ex:axios header)

attempt special
---------------

[](#attempt-special)

- username credential will be optional as (id|email|username) . (ex: facebook username)
- `usernames` describe which columns you want to match for username

```
attempt(["usernames"=>["id","email","name"],"username"=>"request query for username","password=>123456"]);
```

Kauth::check()
--------------

[](#kauthcheck)

```
Kauth::check();
```

Kauth::id()
-----------

[](#kauthid)

```
Kauth::id();
```

Kauth::refreshToken()
---------------------

[](#kauthrefreshtoken)

```
Kauth::refreshToken()
```

Kauth::logout()
---------------

[](#kauthlogout)

```
Kauth::logout();
```

Kauth::logoutOtherDevices()
---------------------------

[](#kauthlogoutotherdevices)

```
Kauth::logoutOtherDevices();
```

[](https://twitter.com/0devco)

[![](https://raw.githubusercontent.com/0devco/docs/master/.devco-images/logo-transparent.png)](https://raw.githubusercontent.com/0devco/docs/master/.devco-images/logo-transparent.png)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity65

Established project with proven stability

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 ~58 days

Total

6

Last Release

2400d ago

Major Versions

v1.0.3 → 3.0.12019-12-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e3bffe09346f036f5a42f64d3b771b9bf41a44ffd712caecac932f69f990ed7?d=identicon)[code4mk](/maintainers/code4mk)

---

Tags

0devcoauthcode4mkjwt-authkauthlaravellaravel-apilaravel-authlaravel-jwtjwtapilaravelauthjwt-authcode4mk0devcolaravel jwt

### Embed Badge

![Health badge](/badges/code4mk-kauth/health.svg)

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

###  Alternatives

[auth0/login

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

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

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

121242.9k1](/packages/ellaisys-aws-cognito)[benbjurstrom/cognito-jwt-guard

A laravel auth guard for JSON Web Tokens issued by Amazon AWS Cognito

1113.1k](/packages/benbjurstrom-cognito-jwt-guard)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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