關閉。這個問題需要細節或清晰。它目前不接受答案。
想改善這個問題嗎?通過編輯此帖子添加詳細資訊并澄清問題。
1 小時前關閉。
改進這個問題我正在為登錄創建自定義控制器,但嘗試顯示為未定義,我無法解決,請幫助
在此處輸入圖片說明
uj5u.com熱心網友回復:
像這樣改變你的變數:
$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');
}
這應該有效
https://laravel.com/docs/7.x/authentication
uj5u.com熱心網友回復:
要使用 Auth Facade,您必須包含 auth Facades。
use Illuminate\Support\Facades\Auth;
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/331011.html
