0

I'd like to know how to pass my controller data to the view using Laravel. This my Controller:

     $ourput =   DB::table('database')
                    ->leftjoin('table', 'database.id', '=', 'table.id')
                  //  ->leftjoin('table', 'table.type_id', '=', 'table.type.id')
                    ->where('database.id', '=', $sess_id )
                     -


                     ->get();
             if($Data){
                return redirect('view')->with('key', $value); 
            }else{
                return FALSE;
            }

        }
3
  • i am print {{$driverprofiles}} like this but i am getting error undefined driverprofiles so how to display data Commented Feb 25, 2019 at 10:24
  • any one please give me a suggection Commented Feb 25, 2019 at 10:34
  • Try return redirect()->route('driverprofile')->with(['driverprofiles' => $driverData]); or redirect()->url('driverprofile')->with(['driverprofiles' => $driverData]); Commented Feb 25, 2019 at 12:41

1 Answer 1

1

I believe you should be trying to return a view, not a HTTP redirect response. In which case instead of this:

return redirect('driverprofile')->with('driverprofiles', $driverData);

it should read something like this

return view('driverprofile')->with('driverprofiles', $driverData);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.