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(9mo ago)194MITPHPPHP ^8.2

Since May 18Pushed 9mo 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 1mo ago

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

36

—

LowBetter than 81% of packages

Maintenance60

Regular maintenance activity

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

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

281d ago

PHP version history (2 changes)1.0.0PHP ^8.1

1.0.6PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/945ebf4aa2a030ad30439ada79eaac3e021d20b5492b35f4b65373ebcbad06da?d=identicon)[jhonHuanuco-dev](/maintainers/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

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[bshaffer/oauth2-server-httpfoundation-bridge

A bridge to HttpFoundation for oauth2-server-php

522.3M12](/packages/bshaffer-oauth2-server-httpfoundation-bridge)[rickycezar/laravel-jwt-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

24117.6k](/packages/rickycezar-laravel-jwt-impersonate)

PHPackages © 2026

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