PHPackages                             elnooronline/laravel-api-authentication - 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. [Framework](/categories/framework)
4. /
5. elnooronline/laravel-api-authentication

AbandonedArchivedPackage[Framework](/categories/framework)

elnooronline/laravel-api-authentication
=======================================

This package used to scaffold basic login, registration and reset password in restful api

v2.0.1(6y ago)38641MITPHP

Since Dec 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Elnooronline/laravel-api-authentication)[ Packagist](https://packagist.org/packages/elnooronline/laravel-api-authentication)[ RSS](/packages/elnooronline-laravel-api-authentication/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (5)Versions (15)Used By (0)

Laravel Api Authentication
==========================

[](#laravel-api-authentication)

> This package used to scaffold basic login, registration and reset password in restful api.

Installation via [composer](https://getcomposer.org/)
-----------------------------------------------------

[](#installation-via-composer)

```
composer require elnooronline/laravel-api-authentication
```

> Import The following traits in `\App\User` model:

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Elnooronline\LaravelApiAuthentication\Models\Traits\HasApiAuthentication;

class User extends Authenticatable
{
    use HasApiAuthentication, Notifiable;
    ...
}
```

Migrations
----------

[](#migrations)

> You must publish the migration files to create the authentication tables.

```
php artisan vendor:publish --tag api-authentication:migration
```

> Then run the following command:

```
php artisan migrate && php artisan passport:install
```

Configration
------------

[](#configration)

> After installation run the following command if you want to override any thing in the package.

```
php artisan vendor:publish --tag api-authentication:config
```

```
// config/api-authentication.php

return [
    /**
     * The name of user model.
     */
    'user-model' => \App\User::class,

    /**
     * Determine whether the application support register service.
     */
    'register' => true,

    /**
     * The resource transformer for the user model.
     */
    'user-resource' => \Elnooronline\LaravelApiAuthentication\Http\Resources\UserResource::class,

    /**
     * The name of onesignal player id field.
     */
    'player-id-field-name' => 'onesignal-player-id',

    /**
     * The urls of the authentications services.
     */
    'urls' => [
        'login' => '/api/login',
        'register' => '/api/register',
        'forget' => '/api/password/forget',
        'check-code' => '/api/password/check-code',
        'reset' => '/api/password/reset',
    ],

    /**
     * The authentications controllers.
     */
    'controllers' => [
        'login' => \Elnooronline\LaravelApiAuthentication\Http\Controllers\Auth\LoginController::class,
        'register' => \Elnooronline\LaravelApiAuthentication\Http\Controllers\Auth\RegisterController::class,
        'forget' => \Elnooronline\LaravelApiAuthentication\Http\Controllers\Auth\ForgotPasswordController::class,
        'reset' => \Elnooronline\LaravelApiAuthentication\Http\Controllers\Auth\ResetPasswordController::class,
    ],

    /**
     * The authentications validation requests.
     */
    'validation' => [
        'login' => \Elnooronline\LaravelApiAuthentication\Http\Requests\LoginRequest::class,
        'register' => \Elnooronline\LaravelApiAuthentication\Http\Requests\RegisterRequest::class,
        'forget' => \Elnooronline\LaravelApiAuthentication\Http\Requests\ForgetPasswordRequest::class,
        'check-code' => \Elnooronline\LaravelApiAuthentication\Http\Requests\CheckCodeRequest::class,
        'reset' => \Elnooronline\LaravelApiAuthentication\Http\Requests\ResetPasswordRequest::class,
    ],
];
```

> If you want to add your own login or registration or reset password you should create custom comtrollers and requests and extends the package classes.

### Examples

[](#examples)

```
// app/Http/Controllers/Api/LoginController.php

namespace App\Http\Controllers\Api\Auth;

use Elnooronline\LaravelApiAuthentication\Http\Controllers\Auth\LoginController as BaseLoginController;

class LoginController extends BaseLoginController
{
    ...
}
```

Then update the `api-authentication.php` and replace the login controller :

```
return [
    ...
    'controllers' => [
        'login' => \App\Http\Controllers\Auth\LoginController::class,
        ...
    ],
    ...
];
```

> Also you can add your own user resource class in `api-authentication.php` config file:

```
return [
    ...
    'user-resource' => \App\Http\Resources\UserResource::class,
    ...
];
```

Events
------

[](#events)

> If you want to add envents during the authentication process. You may attach listeners to these events in your `EventServiceProvider`:

```
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    'Illuminate\Auth\Events\Registered' => [
        'App\Listeners\LogRegisteredUser',
    ],

    'Illuminate\Auth\Events\Login' => [
        'App\Listeners\LogSuccessfulLogin',
    ],

    'Illuminate\Auth\Events\Failed' => [
        'App\Listeners\LogFailedLogin',
    ],

    'Illuminate\Auth\Events\Lockout' => [
        'App\Listeners\LogLockout',
    ],

    'Elnooronline\LaravelApiAuthentication\Events\ResetPasswordCodeGenerated' => [
        'Elnooronline\LaravelApiAuthentication\Listeners\ResetPasswordListener',
     ],
];
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 72.7% 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 ~36 days

Recently: every ~49 days

Total

13

Last Release

2259d ago

Major Versions

v0.1.7 → v1.0.02019-08-29

v1.0.1 → v2.0.02019-12-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23261109?v=4)[Ahmed Fathy](/maintainers/ahmed-aliraqi)[@ahmed-aliraqi](https://github.com/ahmed-aliraqi)

---

Top Contributors

[![ahmed-aliraqi](https://avatars.githubusercontent.com/u/23261109?v=4)](https://github.com/ahmed-aliraqi "ahmed-aliraqi (24 commits)")[![AlShahawi](https://avatars.githubusercontent.com/u/5667648?v=4)](https://github.com/AlShahawi "AlShahawi (6 commits)")[![NohaMahmoud](https://avatars.githubusercontent.com/u/36812276?v=4)](https://github.com/NohaMahmoud "NohaMahmoud (2 commits)")[![OmarSoliman15](https://avatars.githubusercontent.com/u/10255845?v=4)](https://github.com/OmarSoliman15 "OmarSoliman15 (1 commits)")

---

Tags

apiframeworklaravelAuthenticationpassport

### Embed Badge

![Health badge](/badges/elnooronline-laravel-api-authentication/health.svg)

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[jsdecena/laravel-passport-multiauth

Simple laravel passport multiple user authentication

501.1k](/packages/jsdecena-laravel-passport-multiauth)

PHPackages © 2026

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