【发布时间】:2021-10-22 08:45:13
【问题描述】:
【问题讨论】:
-
请分享更多详细信息,例如涉及的代码和确切错误消息
-
请使用
code markup而不是图片分享代码
【问题讨论】:
code markup而不是图片分享代码
像这样改变你的变量:
$user = $request->input('username');
$pass = $request->input('password');
如果还是不行,试试这样:
在文件的顶部:
use Illuminate\Support\Facades\Auth;
然后:
$credentials = $request->only('username', 'password');
if (Auth::attempt($credentials)) {
// Authentication passed...
return view('template.index');
}
【讨论】:
要使用 Auth Facade,您必须包含 auth Facades。
use Illuminate\Support\Facades\Auth;
【讨论】: