PHPackages                             miladev/laravel-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. miladev/laravel-api-auth

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

miladev/laravel-api-auth
========================

API authentication implementation

1.3(2y ago)0311MITPHPPHP &gt;=7.4CI failing

Since Aug 27Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/miladev95/laravel-api-auth)[ Packagist](https://packagist.org/packages/miladev/laravel-api-auth)[ Docs](https://github.com/miladev95/laravel-api-auth)[ RSS](/packages/miladev-laravel-api-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (4)Used By (0)

Laravel API Authentication
==========================

[](#laravel-api-authentication)

[![Latest Stable Version](https://camo.githubusercontent.com/4772dc6a6de084edaa821b6cf4abaa9c448d0b9d5eacf14c2065ac1af61a142e/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c61726176656c2d6170692d617574682f76)](//packagist.org/packages/miladev/laravel-api-auth)[![License](https://camo.githubusercontent.com/b3fefb973df082b1a9b644e545184ebb1f27c08110c2384b4241f0f87a67ffcd/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c61726176656c2d6170692d617574682f6c6963656e7365)](//packagist.org/packages/miladev/laravel-api-auth)[![Total Downloads](https://camo.githubusercontent.com/c49bcdecd8e26e295745c29cbb24558f56aeef84cb707613ba960c54f33a1020/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c61726176656c2d6170692d617574682f646f776e6c6f616473)](//packagist.org/packages/miladev/laravel-api-auth)

[![](https://camo.githubusercontent.com/622a404fe07d0f4d8d2c425a63e420597b70473a3c0a9e621c71c2c9fcc65aa7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d696c6164657639352f6c61726176656c2d6170692d617574682e737667)](https://github.com/miladev95/laravel-api-auth/issues)[![](https://camo.githubusercontent.com/b4de3835c6de9c333b9dc32c506c175c58892b9bea25e00a7064c990feaf64bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d696c6164657639352f6c61726176656c2d6170692d617574682e737667)](https://github.com/miladev95/laravel-api-auth/stargazers)[![](https://camo.githubusercontent.com/d4e2f71cab1b7bfc9812a81d846b80155e60aeb4a61cdfed2ee5f92baf40bd35/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d696c6164657639352f6c61726176656c2d6170692d617574682e737667)](https://github.com/miladev95/laravel-api-auth/network)

Laravel API Authentication Library simplifies API authentication setup in Laravel applications. It provides a set of stubs and tools to help you quickly implement API authentication using Laravel Passport.

Features
--------

[](#features)

- Easy integration of Laravel Passport for OAuth2 authentication.
- Pre-configured stubs for authentication-related files.
- Streamlined API token generation and management.
- Simplified setup process for API authentication.

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

[](#installation)

before install library you need to install passport

To install Laravel Passport, which is a Laravel package that provides OAuth2 authentication for your API, you can follow these steps:

Install Laravel Passport Package
--------------------------------

[](#install-laravel-passport-package)

Open your terminal and navigate to the root directory of your Laravel project. Then run the following Composer command to install the Passport package:

```
composer require laravel/passport
```

Run Migration
-------------

[](#run-migration)

After installing the package, you need to run the migration command to create the necessary database tables for Passport. Run the following command in your terminal:

```
php artisan migrate
```

Install Passport
----------------

[](#install-passport)

Once the migration is complete, you can install Passport using the following command:

```
php artisan passport:install
```

This command will create the encryption keys needed for Passport.

Configure Auth Service Provider
-------------------------------

[](#configure-auth-service-provider)

Open your config/auth.php configuration file and locate the guards configuration. Add a new guard configuration for API authentication using Passport:

```
'guards' => [
    // ...
    'api' => [
        'driver' => 'passport',
        'provider' => 'users',
    ],
],
```

**You can install the package via composer:**

```
composer require miladev/laravel-api-auth
```

If you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.

```
php artisan vendor:publish --tag=stubs
```

DONE, now you have AuthController With Auth Request with features like login, register, logout.

Contribute
----------

[](#contribute)

Contributions are welcome! If you have improvements or bug fixes to suggest, feel free to open issues and submit pull requests.

License
-------

[](#license)

This library is open-source software licensed under the MIT License.

Happy coding! 👨‍💻👩‍💻

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance56

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

993d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/804b53db0aff0c136bb3b1ead2f1d660ef00e4ce1650aa49e6edf0fc2338921c?d=identicon)[miladev95](/maintainers/miladev95)

---

Top Contributors

[![miladev95](https://avatars.githubusercontent.com/u/35612406?v=4)](https://github.com/miladev95 "miladev95 (17 commits)")

---

Tags

api-authlaravel-apimiladevlaravel api auth

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

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