定制 voyager-inc/basic-auth 二次开发

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

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

voyager-inc/basic-auth

Composer 安装命令:

composer require voyager-inc/basic-auth

包简介

Basic auth

README 文档

README

PHP v8.2

Laravel v11.x

Installation

composer require voyager-inc/basic-auth
  • Publish provider
php artisan vendor:publish --provider="VoyagerInc\BasicAuth\ServiceProvider"

Usage

  • We have new middleware with the aliases basic-auth
return [
    'enabled' => env('BASIC_AUTH_ENABLED', true), // 'true' to enable, 'false' to disable
    'username' => 'admin', // config username
    'password' => 'password', // config password
    'error_message' => 'Unauthorized', // custom error message
    'headers' => [ // config headers
        'WWW-Authenticate' => 'Basic realm="Sample Private Page"',
        'Content-Type' => 'text/plain; charset=utf-8'
    ],
];
  • Example
Route::get('/test', function () {
    return 'basic auth route';
})->middleware(['basic-auth']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-10