PHPackages                             bitfumes/api-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. bitfumes/api-auth

ActiveLibrary

bitfumes/api-auth
=================

Your Package Description here

v6.0.0(3y ago)62254MITPHP

Since Mar 3Pushed 3y agoCompare

[ Source](https://github.com/bitfumes/laravel-api-auth)[ Packagist](https://packagist.org/packages/bitfumes/api-auth)[ RSS](/packages/bitfumes-api-auth/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (7)Dependencies (11)Versions (12)Used By (0)

api-auth
========

[](#api-auth)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub issues](https://camo.githubusercontent.com/3f7b832552794c3bce207dbd7d036185378b543e545c96827a9df2a4f459d3d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f62697466756d65732f6c61726176656c2d6170692d61757468)](https://github.com/bitfumes/laravel-api-auth/issues)[![Total Downloads](https://camo.githubusercontent.com/ddf67a329c744a7ec6138112f2927409f34831f5641e3275947be1d486198a04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62697466756d65732f6170692d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bitfumes/api-auth)[![Build Status](https://camo.githubusercontent.com/f70d1eafd8f6bffa687aae094191b118de8e8da8a31ebf8fb93884b2d7b8f129/68747470733a2f2f7472617669732d63692e6f72672f62697466756d65732f6c61726176656c2d6170692d617574682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bitfumes/laravel-api-auth)

Install
=======

[](#install)

`composer require bitfumes/api-auth`

Steps to follow
===============

[](#steps-to-follow)

Steps 1
-------

[](#steps-1)

1. Add Contract `hasApiAuth` and `JWTSubject` to your authenticatable model like shown below:
2. Add `ApiAuth` trait to your user model.

```
use Bitfumes\ApiAuth\Traits\ApiAuth;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Bitfumes\ApiAuth\Contract\HasApiAuth;

class User extends Authenticatable implements HasApiAuth, JWTSubject
{
    use Notifiable, ApiAuth;
    ...
}
```

Step 2
------

[](#step-2)

Configure your config/auth.php file to update guard details

- Update default guard to api

```
'defaults' => [
        'guard'     => 'api',
        ...
    ],
```

- Update api guard to 'jwt'

```
'guards' => [
        ... ,

        'api' => [
            'driver'   => 'jwt',
            ...
        ],
    ],
```

Step 3
------

[](#step-3)

Add new accessor to your authenticatable model

```
public function setPasswordAttribute($value)
{
    $this->attributes['password'] = bcrypt($value);
}
```

Step 4
------

[](#step-4)

Now publish two new migrations

1. To add avatar field to your use model.
2. To add social login profile.

```
php artisan vendor:publish --tag=api-auth:migrations
```

Step 5
------

[](#step-5)

After getting migrations in your laravel application, its time to have these tables in your database.

```
php artisan migrate
```

Step 6
------

[](#step-6)

Because every user need to verify its email and to send email we are going to use laravel queue.

Now add queue driver on your `.env` file

That's it, now enjoy api auth with JWT

```
QUEUE_DRIVER=database

```

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

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.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~213 days

Total

11

Last Release

1152d ago

Major Versions

v1.0.0 → v2.0.02020-03-13

v2.0.2 → v3.0.02020-09-12

v3.2.0 → v4.0.02021-09-09

v4.1.0 → v5.0.02022-02-09

v5.0.0 → v6.0.02023-03-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a9226970b64f8955d80a2a7e50617a178e9cf7940b2aaa8cc302e7b0687ae67?d=identicon)[Bitfumes](/maintainers/Bitfumes)

---

Top Contributors

[![sarthaksavvy](https://avatars.githubusercontent.com/u/41295276?v=4)](https://github.com/sarthaksavvy "sarthaksavvy (39 commits)")

---

Tags

api-authjwt-authLaravel multiauthbitfumesauth for api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bitfumes-api-auth/health.svg)

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[lavalite/cms

Lavalite - The Laravel CMS.

2.9k56.3k](/packages/lavalite-cms)[bitfumes/laravel-multiauth

Laravel Multiauth package

46534.7k1](/packages/bitfumes-laravel-multiauth)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)

PHPackages © 2026

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