title: Laravel get api from curl than jsondecode with ajax
body: <p>I have an index route  <a href="http://localhost/index" rel="nofollow noreferrer">http://localhost/index</a>
  I need help to create  jquery ajax to get  the json data from url <a href="http://localhost/mylist" rel="nofollow noreferrer">http://localhost/mylist</a>  and  format the json data to display it as a html table.</p>
  
  <p>Here is my 2 routes in Laravel</p>
  
  <pre><code> Route::get('index', function () {
   return view('index');
   });
  
   Route::get('mylists', 'ExampleController@mylists');
  </code></pre>
  
  <p>Here is ExampleController.php  method </p>
  
  <pre><code>public function mylists()
  {
  
  \\Here i do a cURL get request to my remote api befor I return $data
  
   return $data = json_decode($contact_list)
  
  }
  </code></pre>
  
  <p>So if Someone navigate to  url  <a href="http://localhost/mylist" rel="nofollow noreferrer">http://localhost/mylist</a> they will see  </p>
  
  <pre><code>{ "name":"John", "age":30, "city":"New York"}
  </code></pre>
  
  <p>I have an index route as well  <a href="http://localhost/index" rel="nofollow noreferrer">http://localhost/index</a>
  I need help to create  jquery ajax to get  the json data from url <a href="http://localhost/mylist" rel="nofollow noreferrer">http://localhost/mylist</a>  and  format the json data to display it as a html table.</p>