如何在Laravel 5中创建http基本身份验证?如何在Laravel 5中创建http基本认证?
我已阅读这里的文档: https://laravel.com/docs/5.0/authentication#http-basic-authentication
我想创建一个固定的密码,为整个网站只意味着一个密码。
但我仍不清楚如何创建它。
我明白,我要创建这样一个中间件:
public function handle($request, Closure $next)
{
return Auth::onceBasic() ?: $next($request);
}
但后来我不知道还能做什么。 例如,我要保护这条路线:
Route::get('/', function() {
return view('welcome');
});
而且也,我在哪里存储在服务器上的HTTP基本密码?
感谢
此解决方案适用于我 –