1
當我嘗試在驗證登錄到laravel時推送會話時遇到問題。 我的代碼語法如下:嘗試登錄laravel時推送會話
$valid = DB::table('users')
->select(DB::raw('count(email) as email'))
->where('email' , '=', $request['email'])
->where('password', '=', bcrypt($request['password']))
->first();
$count = $valid->email;
if($count > 1) {
$permit = DB::table('users')
->select('permit')->where('email' ,'=', $request['email'])->first();
$permit = $permit->permit;
$user_id = DB::table('users')
->select('user_id')->where('email' ,'=', $request['email'])->first();
$user_id = $user_id->user_id;
Session::flush();
Session::push('permit', $permit);
Session::push('user_id', $user_id);
}
我知道方法bcrypt()不返回相同的字符串另一次,所以我能爲問題呢?
工作corecctly訪問用戶現場像這樣
進口權威性類? – paranoid
我試過了, > 'if(Auth :: attempt($ credentials,$ request-> has('remember'))){ Session :: push(); 返回重定向() - >意向($ this-> redirectPath()) - > withInput() - > with('message','Login successful'); } else if(Auth :: attempt($ credentials)){ Session :: push(); 返回重定向() - >意向($ this-> redirectPath()) - > withInput() - > with('message','Login successful'); } ' 但不工作,.. –
什麼錯誤顯示? – paranoid