I have two different queries which are saved in two variables.I want to pass the variables to view page from controller.
public function getApprovalList(){
// $users = select query..
// $request = select query..
return view('travelerHome',['users'=>$users,'request'=>$request]);
}
solved by
controller
return view('travelerHome',['users'=>$users,'requestList'=>$request]);
view blade
@foreach ($requestList as $req)
{{$req->traveler_name }}
@endforeach