mardi 2 février 2016

try to push session when login laravel

I have problem when I try to push session when validate login into laravel. My code following syntax:

$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);
        }

I know method bcrypt() not return the same string another time, so what can I do for problem ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire