title: Laravel + Wordpress
body: <p>I want to make a simple thing: display wordpress posts on my website from sql code.
  I have done this, which is very bad:</p>
  
  <pre><code>use App\Http\Controllers\Controller;
  
  class WordPressController extends Controller
  {
      private $datatableName = "www1";
  
     /** 
      * [collectData description]
      * 
      * @param  int $numElements
      * @param  null $page
      * @return 
      */
      public function collectData($numElements=0, $page=NULL)
      {
          global $mysqli;
          $query = "SELECT post_author, post_date, post_title, 
                      post_content FROM `www1_posts` ORDER BY post_date";
          $result = $mysqli-&gt;query($query);
  
          while(($post_row = $result-&gt;fetch_assoc))
          {
              //
          }
      }
  
      /**
       * [setDatatableName description]
       * 
       * @param string $datatableName
       */
      public function setDatatableName(string $datatableName) 
      {
          $this-&gt;datatableName = $datatableName;
      }
  }
  </code></pre>
  
  <p>What I want to is map table "www1_posts" from Wordpress with a Model (Post) and a view which I 'll call "book.layout.blade.php"</p>
  
  <p>I don't how to write migration from an existing table. Should I write down all the fields ? Or can I grab the table structure from Migration or a Laravel framework class.</p>