PHPackages                             jhonhuanuco-dev/security-pe - 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. jhonhuanuco-dev/security-pe

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

jhonhuanuco-dev/security-pe
===========================

Security-pe proporciona un sistema de autenticación y seguridad para APIs simples.

1.0.6(11mo ago)094MITPHPPHP ^8.2

Since May 18Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/jhonHuanuco-dev/security-pe)[ Packagist](https://packagist.org/packages/jhonhuanuco-dev/security-pe)[ Docs](https://github.com/jhonHuanuco-dev/security-pe)[ RSS](/packages/jhonhuanuco-dev-security-pe/feed)WikiDiscussions 1.x Synced today

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

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

[](#installation)

1. To install the package use the following command:

```
  composer require jhonhuanuco-dev/security-pe
```

2. Register the service provider in the `bootstrap/providers.php` file:

```
return [
  /*
    * Package Service Providers...
    */

  Jhonhdev\SecurityPe\SecurityPeServiceProvider::class,
];
```

3. Publish the configuration file `config/securitype.php` with the following command:

```
  php artisan vendor:publish --provider="Jhonhdev\SecurityPe\SecurityPeServiceProvider"
```

4. Remove the following migrations to avoid conflicts, as Security.pe migrations will be used by default:

- `users`
- `personal_access_tokens`

5. Modify your `app/Models/User.php` model.

```
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
use Jhonhdev\SecurityPe\Models\Schemas\Security\Users;

class User extends Users
{
  use HasFactory, Notifiable;
}
```

6. Add a default connection string for your database in `config/database.php` called **default**.:

```
return [
  'connections' => [
    //...

    'default' => [
      //...
    ]
  ]
];
```

7. Register the middleware of `ActivityUserRequest` in the `bootstrap\app.php`.:

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->alias([
        //...
        'activity' => \Jhonhdev\SecurityPe\Http\Middleware\ActivityUserRequest::class,
    ]);
})
```

8. Update your configuration file `config/securitype.php` according to your needs before running the migrations..
9. Execute the following command to run the migrations:

```
  php artisan migrate
```

Usage
-----

[](#usage)

#### Log-in

[](#log-in)

Authenticate your application users and register the encrypted token in the database.

```
  POST /securitype/auth/login
```

ParameterTypeDescription`username``string`**Required**. User name registered in the database.`password``string`**Required**. Password of the user registered in the database.```
{
  "status": true,
  "message": "Bienvenido John Smith",
  "user": {
    "branch_id": 1,
    "username": "jhsm",
    "name": "John",
    "last_name": "Smith",
    "email": "example@company.com",
    "extension": 102,
    "state": true
  },
  "token": {
    "key": "1|iplxuLz78Ff9nS1ECDalNv2wJUFJMFVLemBOQJvz",
    "expired": "2024-05-16 22:30:09"
  }
}
```

#### Log-out

[](#log-out)

Removes the session token of the authenticated user.

```
  GET /securitype/auth/logout
```

ParameterTypeDescription`Bearer``string`**Automatic**. Bearer token```
{
  "status": true,
  "message": "Hasta pronto.",
}
```

#### Validate Token.

[](#validate-token)

Validate if the token is valid and/or has not expired. The user must be authenticated and the bearer token must be included in the request header.

```
  POST /securitype/auth/validatetoken
```

ParameterTypeDescription`Bearer``string`**Automatic**. Bearer token```
{
  "status": true,
  "message": "Ok.",
}
```

Authors
-------

[](#authors)

- [@jhonHuanuco-dev](https://github.com/jhonHuanuco-dev)

License
-------

[](#license)

Security.pe is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance52

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

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

Every ~63 days

Recently: every ~96 days

Total

8

Last Release

336d ago

PHP version history (2 changes)1.0.0PHP ^8.1

1.0.6PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/102885419?v=4)[jhonhdev](/maintainers/jhonHuanuco-dev)[@jhonHuanuco-dev](https://github.com/jhonHuanuco-dev)

---

Tags

authsecurity.pe

### Embed Badge

![Health badge](/badges/jhonhuanuco-dev-security-pe/health.svg)

```
[![Health](https://phpackages.com/badges/jhonhuanuco-dev-security-pe/health.svg)](https://phpackages.com/packages/jhonhuanuco-dev-security-pe)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)

PHPackages © 2026

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