title: Laravel: Change the div with ajax and multiple controller@action
body: <p>I want to change the <code>div</code>'s content with <code>AJAX</code> (I don't want to reload all of the page when I click on the links), i found some documentations, but I only saw "static" solutions (they  are "hard coded" that "if you click on this bring this", but I don't want to use a 3000 row switch-case on the bottom of my project).</p>
  
  <p>Someone can show me a "dynamic" solution where I only have to give the controller, action and the parameters to the on-click and the <code>jquery</code> router makes the routing without tinkering?</p>
  
  <p>My example code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="{{ app()-&gt;getLocale() }}"&gt;
      &lt;head&gt;
          @include('includes.head')
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="header"&gt;
           &lt;nav id="navbar" class="navbar navbar-default"&gt;
             &lt;ul class="nav nav-tabs navbar-right"&gt;
                  &lt;li&gt;
                      &lt;a action="FirstExampleController@firstExamle" params="[a =&gt; 24, b =&gt; 52]"&gt;
                          &lt;button type="button" class="btn btn-link"&gt;First Example&lt;/button&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a action="SecondExampleController@secondExamle" params="[id =&gt; 1, newValue =&gt; 42]"&gt;
                          &lt;button type="button" class="btn btn-link"&gt;Second Example&lt;/button&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
           &lt;/nav&gt;
          &lt;/div
          &lt;div id="app"&gt;
              &lt;!-- This will be changed by the router --&gt;
          &lt;/div&gt;
          &lt;footer class="container navbar"&gt;
              @include('includes.footer')
          &lt;/footer&gt;
  
          &lt;!-- Scripts --&gt;
          &lt;script src="{{ asset('js/app.js') }}"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Controller Actions</p>
  
  <pre><code>class FirstExampleController extends Controller{
  
      public function firstExample(Request $request){
          $a = $request -&gt; a;
          $b = $request -&gt; b;
  
          $c = $a + $b;
  
          return $c;
      }
  }
  
  class SecondExampleController extends Controller{
  
      public function secondExample(Request $request){
          $id = $request -&gt; id;
          $newValue = $request -&gt; newValue;
  
          //database operation where the id's object's new value will be $newValue
  
          return $this-&gt;showItems;
      }
  }
  </code></pre>