samedi 17 décembre 2016

How to pass session value in laravel 5.2

I want to pass $var variable with session to a page . And want to receive this data.

public function check(Request $request)
{
    $c_email = $request->email;
    $c_pass=$request->pass;
    $c_type=$request->select;
    //dd($Idpass);
   $var=DB::select("SELECT * FROM reg where email = '$c_email' and Password = '$c_pass' and type = '$c_type'");
   if ($var) {
       session_start();
       $request->session()->put('key', '$var');
     return redirect('farmer');
   }
   else {
    $msg="Invalid login";
    return view('index')->with('show',$msg);
   }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire