1 回答

TA貢獻(xiàn)2065條經(jīng)驗(yàn) 獲得超14個(gè)贊
如果用戶未通過(guò)身份驗(yàn)證,那么您將收到意外錯(cuò)誤。所以首先檢查authasAuth::check()
嘗試這個(gè) :
use Illuminate\Support\Facades\Auth;
public function index()
{
if(!Auth::check()) {
return view('login');
}
$applications = Application::where('user_id', $Auth::user()->id)->first();
if (empty($applications)) {
return redirect(route('user.application.index'))->with('message','Application is Succesfully');;
}
else{
return view('user.application.index',compact('applications'));
}
}
- 1 回答
- 0 關(guān)注
- 107 瀏覽
添加回答
舉報(bào)