Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be done in many various ways. </p> <p>First, you can do this : </p> <pre><code>public function get_show($call_id) { $call = Phonecall::find($call_id); return View::make('phonecalls.single')-&gt;with('phonecal', $call); } </code></pre> <p>In which case you need to create a template for a single phonecall and put it in your phonecalls folder.</p> <p>Another option is to return JSON response from the Laravel app :</p> <pre><code>public function get_show($call_id) { $call = Phonecall::find($call_id)-&gt;first(); return Response::eloquent($call); } </code></pre> <p>Another option is to use javascript MVC framework to make things like fetching/updating AJAX data very easy, for example Backbone JS or Angular JS can do that. </p> <p>Either way, if you want to do AJAX data you need to build an API to make a separation between regular site and AJAX data backend.</p> <p>Here is my blog post with lots of details on how to accomplish this: <a href="http://maxoffsky.com/code-blog/building-restful-api-in-laravel-start-here/" rel="nofollow">http://maxoffsky.com/code-blog/building-restful-api-in-laravel-start-here/</a></p> <p>Also, a great introduction for AJAX in Laravel is Code Happy by Dayle Rees, chapter AJAX content : codehappy.daylerees.com/ajax-content</p> <p>Let me know if you have more questions, and approve this comment if you feel like I've helped. Thanks!</p> <p>UPDATE: </p> <p>To actually load stuff in from the controller (or a Laravel route) you need to use jQuery ajax, GET(to load data) or POST(to post form results) Here's an example: </p> <pre><code> $('#get-info').click(function(e) { // e=event e.preventDefault(); var BASE = "&lt;?php echo URL::base(); ?&gt;"; // attempt to GET the new content $.get(BASE+'phonecalls/show/2', function(data) { $('#content').html(data); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload