定制 handersonsilva/laravel-access 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

handersonsilva/laravel-access

最新稳定版本:1.0.6

Composer 安装命令:

composer create-project handersonsilva/laravel-access

包简介

A package to manage access to your Laravel application per environment

README 文档

README

Total Downloads Latest Stable Version License

About Laravel Access

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

Requirements

  • PHP >= 8.3
  • Laravel >= 10.0

Services required

  • Email Server (any driver)
  • Cache (any driver)

Installation

Add the package to your project

composer require handersonsilva/laravel-access

Publish the package in your project

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

Middleware

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

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

Run the initial configuration

php artisan access:install

Configuration

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

Add the following code to the config/access.php 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_prefixes' => ['/admin'], # Prefixes to block access to the application ex: ['/admin', '/private']

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

Auto Login

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.

Security Vulnerabilities

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

License

The Laravel Access framework is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-19