title: Laravel how to pass data from controller to blade
body: <p>I'm building a Laravel site. I want submitted form data to run a query and the results to be inserted into a table format. I am using oracle DB and I have connected it to Laravel. Also, I have created the form, and the query gives the results right. What I can't do is to pass results into the table successfully.</p>
  <p>My files are the following:</p>
  <ol>
  <li><p>Routes.php (or web.php for newer laravel versions):</p>
   
  <li><p>The search.blade.php (which is the form with the post method)</p>
  
  
      
          
            -->
          User Data Entry
      
      
          Input Data
  -->
         Input Data
  <pre><code>    &lt;form method=&quot;post&quot; action=&quot;/dedomena&quot; id=&quot;forma&quot;&gt;
          {{ csrf_field() }}
          &lt;fieldset&gt;
              &lt;legend&gt;Insert&lt;/legend&gt;
              Registration Number:&lt;br&gt;
              &lt;input type=&quot;number&quot; name=&quot;AM&quot; min=&quot;1000000&quot; max=&quot;9999999&quot;&gt;&lt;br&gt;
              &lt;input type=&quot;submit&quot; value=&quot;Search&quot;&gt;
          &lt;/fieldset&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  </li>
  <li><p>My controller (NewController.php) runs the query. The results are displayed correctly but in a list format. I want to put them in a table format.</p>
   get('AM');
           echo('Results for student with registration number: ');
           echo($myVar);
           $entries = DB::table('SCC_ANSWER')->where('AM', $myVar)->get();
           dd($entries);
       }
   }
  
  </li>
  </ol>
  <p>I want to be passed at another blade called pinakas.blade.php which should look like the following. How can I do that?</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
      &lt;head&gt;
          &lt;meta charset=&quot;UTF-8&quot;&gt;
          &lt;title&gt;Results&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;table border=&quot;1&quot;&gt;
              &lt;tr&gt;
                  &lt;th&gt;AM&lt;/th&gt;
                  &lt;th&gt;ST&lt;/th&gt;
                  &lt;th&gt;CS&lt;/th&gt;
                  &lt;th&gt;REGYEAR&lt;/th&gt;
                  &lt;th&gt;REGTERMIN&lt;/th&gt;
                  &lt;th&gt;CSYEAR&lt;/th&gt;
                  &lt;th&gt;REGTYPE&lt;/th&gt;
                  &lt;th&gt;REGDESCR&lt;/th&gt;
                  &lt;th&gt;STATUS&lt;/th&gt;
                  &lt;th&gt;STGROUP&lt;/th&gt;
                  &lt;th&gt;SEM1&lt;/th&gt;
                  &lt;th&gt;SEM2&lt;/th&gt;
                  &lt;th&gt;SEM3&lt;/th&gt;
                  &lt;th&gt;SEM4&lt;/th&gt;
                  &lt;th&gt;SEM5&lt;/th&gt;
                  &lt;th&gt;SEM6&lt;/th&gt;
                  &lt;th&gt;SEM7&lt;/th&gt;
                  &lt;th&gt;SEM8&lt;/th&gt;
                  &lt;th&gt;SEM9&lt;/th&gt;
                  &lt;th&gt;SEM10&lt;/th&gt;
                  &lt;th&gt;SEM11&lt;/th&gt;
                  &lt;th&gt;SEM12&lt;/th&gt;
                  &lt;th&gt;SEM1B&lt;/th&gt;
                  &lt;th&gt;SEM2B&lt;/th&gt;
                  &lt;th&gt;SEM3B&lt;/th&gt;
                  &lt;th&gt;SEM4B&lt;/th&gt;
                  &lt;th&gt;SEM5B&lt;/th&gt;
                  &lt;th&gt;SEM6B&lt;/th&gt;
                  &lt;th&gt;SEM7B&lt;/th&gt;
                  &lt;th&gt;SEM8B&lt;/th&gt;
                  &lt;th&gt;SEM9B&lt;/th&gt;
                  &lt;th&gt;SEM10B&lt;/th&gt;
                  &lt;th&gt;SEM11B&lt;/th&gt;
                  &lt;th&gt;SEM12B&lt;/th&gt;
                  &lt;th&gt;SEM1P&lt;/th&gt;
                  &lt;th&gt;SEM2P&lt;/th&gt;
                  &lt;th&gt;SEM3P&lt;/th&gt;
                  &lt;th&gt;SEM4P&lt;/th&gt;
                  &lt;th&gt;SEM5P&lt;/th&gt;
                  &lt;th&gt;SEM6P&lt;/th&gt;
                  &lt;th&gt;SEM7P&lt;/th&gt;
                  &lt;th&gt;SEM8P&lt;/th&gt;
                  &lt;th&gt;SEM9P&lt;/th&gt;
                  &lt;th&gt;SEM10P&lt;/th&gt;
                  &lt;th&gt;SEM11P&lt;/th&gt;
                  &lt;th&gt;SEM12P&lt;/th&gt;
                  &lt;th&gt;TOTAL&lt;/th&gt;
                  &lt;th&gt;TOTALB&lt;/th&gt;
                  &lt;th&gt;TOTALP&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                 // &lt;td&gt;&lt;?php $entries?&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>