tecbeast/basic-auth-with-env

一个用于 Laravel 5.1+ 的中间件,可以在任何 web 服务器上使用基本认证。仅依赖于一个配置文件。

1.0.1 2017-05-10 15:37 UTC

This package is auto-updated.

Last update: 2024-09-07 18:22:27 UTC


README

一个用于 Laravel 5.1+ 的中间件,可以在任何 web 服务器上使用基本认证。仅依赖于一个配置文件。

安装

composer require tecbeast/basic-auth-with-env

将服务提供者添加到 config/app.php 中的 providers 数组

'providers' => [

    ...

    TecBeast\BasicAuthWithEnv\BasicAuthServiceProvider::class,

],

将中间件添加到 app/Http/Kernel.php 中的 middleware 数组(对于全局,否则添加到路由或分组(Laravel 5.2+)

protected $middleware = [
    ...
    \TecBeast\BasicAuthWithEnv\Middleware\BasicAuth::class,
];

将配置发布到您的应用程序

php artisan vendor:publish --provider="TecBeast\BasicAuthWithEnv\BasicAuthServiceProvider"