Retrieve data from database using ajax with laravel
<p>I'm able to select a value from database and throw it inside a <code>&lt;div&gt;</code>.<br>
My problem is, I don't know how to do so and follow the <code>MVC</code> rules, as I'm using <code>Laravel</code> framework.  </p>

<p>Here is what I've done so far:  </p>

<h3>Index.php</h3>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="https://code.jquery.com/jquery-2.2.3.min.js"   integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo="   crossorigin="anonymous"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="wrapper"&gt;
        &lt;input type="button" id="btn" value="Click Me :)"&gt;&lt;/input&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;  
</code></pre>

<h3>Ajax.php</h3>

<pre><code>&lt;?php

include ('db.php');

$pdo = connect();

$dados = $pdo-&gt;prepare("SELECT field FROM table WHERE id = ?");
$dados-&gt;execute(array("2"));
$usr = $dados-&gt;fetch(PDO::FETCH_ASSOC);


echo "&lt;p&gt; Nome:" .$usr["nome"]. "&lt;/p&gt;"; //Teste  
</code></pre>

<h3>Script.js</h3>

<pre><code>$(document).ready(function(){
    $('#btn').click(function(){
        $.ajax({
        url: "ajax.php",
        type: "GET",
        dataType: "html", //expected return type        
        success: function(response){
            $('#calendario').fullCalendar(
            'renderEvent',
            {
                title: 'Novo evento',
                start: '2016-04-06T08:00:00', // I need to put the data here
                end:'2016-04-06T10:30:00'    // And here aswell
            }
        );
        }

    })

    });
});
</code></pre>

<p>I made this as a test, and it's working... How may I do the same using <code>Laravel MVC</code> ?  Here I had to create a custom php file (ajax.php) only to make the select. Is there a way to do the same thing using my <code>Controller /Model</code>?</p>