PHPackages                             handersonsilva/laravel-access - 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. handersonsilva/laravel-access

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

handersonsilva/laravel-access
=============================

A package to manage access to your Laravel application per environment

1.0.6(1y ago)08MITPHPPHP ^8.2

Since Dec 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HandersonSilva/laravel-access)[ Packagist](https://packagist.org/packages/handersonsilva/laravel-access)[ RSS](/packages/handersonsilva-laravel-access/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

[![](https://private-user-images.githubusercontent.com/18010964/397544346-64455349-d3ed-405b-b868-b8a0059f8efb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NzM2MzMsIm5iZiI6MTc3NTQ3MzMzMywicGF0aCI6Ii8xODAxMDk2NC8zOTc1NDQzNDYtNjQ0NTUzNDktZDNlZC00MDViLWI4NjgtYjhhMDA1OWY4ZWZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDExMDIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmN2U4Y2JjZGJlNDhhZTdlYjVhMThmYWU1Y2IyZTdjNDU3OTM1ZDdiM2RlZWJiOTgyOGQwNWI1MGI3YTY4ZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zWNyYb1uL1lmLcXrUfdO5Z3AzfzEix7Qz06N9-hbLbM)](https://private-user-images.githubusercontent.com/18010964/397544346-64455349-d3ed-405b-b868-b8a0059f8efb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NzM2MzMsIm5iZiI6MTc3NTQ3MzMzMywicGF0aCI6Ii8xODAxMDk2NC8zOTc1NDQzNDYtNjQ0NTUzNDktZDNlZC00MDViLWI4NjgtYjhhMDA1OWY4ZWZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDExMDIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmN2U4Y2JjZGJlNDhhZTdlYjVhMThmYWU1Y2IyZTdjNDU3OTM1ZDdiM2RlZWJiOTgyOGQwNWI1MGI3YTY4ZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zWNyYb1uL1lmLcXrUfdO5Z3AzfzEix7Qz06N9-hbLbM)

[![](https://private-user-images.githubusercontent.com/18010964/397544404-a32c9b19-9d93-4842-a33b-47757b751d97.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NzM2M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lnbmF0dXJlPWMxNWU1NDU4YzQ2MWViMmZkMTc1M2UyMzM0Mjg2OGFjOTVhNDVmODA1MWUwYzQ1MWQ3M2NkNmY0ZjAwMGIyZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WqRhvPumRVe_4ZOcd-nhi-LwFDOHkxPChutahuWvZxM)

[![Total Downloads](https://camo.githubusercontent.com/408adaeb68230b473fbb798f7a00fd41c94cac62d9d966a433cbab83afe1febb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f48616e646572736f6e53696c76612f6c61726176656c2d616363657373)](https://packagist.org/packages/HandersonSilva/laravel-access)[![Latest Stable Version](https://camo.githubusercontent.com/886dbeecd6d7af525fff881244ace380c974232d50ac2c55be084ec417c51bf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f48616e646572736f6e53696c76612f6c61726176656c2d616363657373)](https://packagist.org/packages/HandersonSilva/laravel-access)[![License](https://camo.githubusercontent.com/1dc60c1c5ddad1985ba046fb16a3e5847380cbff990e81262df47189b4f8c50c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f48616e646572736f6e53696c76612f6c61726176656c2d616363657373)](https://packagist.org/packages/HandersonSilva/laravel-access)

About Laravel Access
--------------------

[](#about-laravel-access)

Laravel Access is a package that provides a simple way to manage access control per environments in Laravel applications.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Laravel &gt;= 10.0

#### Services required

[](#services-required)

- Email Server (any driver)
- Cache (any driver)

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

[](#installation)

### Add the package to your project

[](#add-the-package-to-your-project)

```
composer require handersonsilva/laravel-access
```

### Publish the package in your project

[](#publish-the-package-in-your-project)

```
php artisan vendor:publish --provider="SecurityTools\LaravelAccess\Providers\AccessServiceProvider"
```

### Middleware

[](#middleware)

#### Add the following code to the app/Http/Kernel.php file on the global middleware

[](#add-the-following-code-to-the-apphttpkernelphp-file-on-the-global-middleware)

```
protected $middleware = [
        \SecurityTools\LaravelAccess\Middleware\AccessMiddleware::class,
        ...
];
```

### Run the initial configuration

[](#run-the-initial-configuration)

```
php artisan access:install
```

Configuration
=============

[](#configuration)

### Add environments in the .env file

[](#add-environments-in-the-env-file)

```
# Access
ACCESS_ENABLE=true # Enable access
ACCESS_SECRET=your_secret_key # Generate any secret key
```

### Block access to the application per environment

[](#block-access-to-the-application-per-environment)

#### Add the following code to the config/access.php file to block access to the application in the environments you want.

[](#add-the-following-code-to-the-configaccessphp-file-to-block-access-to-the-application-in-the-environments-you-want)

```
'block_env' => ['local'], # Environments to block access to the application ex: ['local', 'staging', 'production']
```

### Block access to the application per route prefix

[](#block-access-to-the-application-per-route-prefix)

```
'block_prefixes' => ['/admin'], # Prefixes to block access to the application ex: ['/admin', '/private']
```

### Define the default route to redirect the user after validation

[](#define-the-default-route-to-redirect-the-user-after-validation)

```
'redirect_prefix' => '/admin',# Default route to redirect the user after validation default: '/'
```

### See the complete configuration in the config/access.php file

[](#see-the-complete-configuration-in-the-configaccessphp-file)

Auto Login
----------

[](#auto-login)

### To enable auto login, add the following code to the .env file

[](#to-enable-auto-login-add-the-following-code-to-the-env-file)

```
# Access
ACCESS_AUTO_LOGIN=true # Enable auto login
ACCESS_GUARD=web # Guard to be used for authentication
```

#### When auto login is enabled, the user will be automatically authenticated to the application without the need to enter the login and password.

[](#when-auto-login-is-enabled-the-user-will-be-automatically-authenticated-to-the-application-without-the-need-to-enter-the-login-and-password)

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within Laravel Access, please send an e-mail to Handerson Silva via . All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

The Laravel Access framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

4

Last Release

481d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6b986323439d252fedaef8bdfd63a0929660cabcd7e711e095c506dad5f79cd?d=identicon)[HandersonSilva](/maintainers/HandersonSilva)

---

Top Contributors

[![HandersonSilva](https://avatars.githubusercontent.com/u/18010964?v=4)](https://github.com/HandersonSilva "HandersonSilva (31 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/handersonsilva-laravel-access/health.svg)

```
[![Health](https://phpackages.com/badges/handersonsilva-laravel-access/health.svg)](https://phpackages.com/packages/handersonsilva-laravel-access)
```

###  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)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[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)

PHPackages © 2026

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