title: how to print variable from laravel controller?
body: <p>I am calling a php file using in laravel controller. While calling the file I passing few data using ajax call. I want to print the variable that is passed to the controller file. Below is my code-</p>
  
  <pre><code>function handleJSON(originePlaceID, destPlaceID){
                  var elements = document.getElementsByClassName('waypoints'); //getting the values from input field
                  var wayptArray = new Array();
                  for(var i = 0; i &lt; elements.length; i++){
                      if(elements[i].value != "") {
                          wayptArray.push(elements[i].value);
                          }
                      }
                  var JsonWaypt = JSON.stringify(wayptArray);
                  $.ajax({
                      type: "GET",
                      url: "placeIdApi",
                      data: {data : JsonWaypt, _token: '{{csrf_token()}}'}, 
                      cache: false,
                      success: function(places){
                          console.log(places);
                      }
                  });
                  }
  </code></pre>
  
  <p>My web.php file:</p>
  
  <pre><code>Route::get('/placeIdApi', 'placeId@index');
  </code></pre>
  
  <p>My controller file(placeId.php)</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  class placeId extends Controller
  {
       public function index(Request $request){
          $values = $request-&gt;data; //I want to print this $values variable.
  
      }
  }
  </code></pre>
  
  <p>Can anyone suggest me how to print this $request or $values variable? Thanks in advance.</p>