title: Laravel how to call Console command from a Database Seeder
body: <p>I am writing some seeders for my Laravel instance's database. I'm using the <a href="https://github.com/teamtnt/laravel-scout-tntsearch-driver" rel="nofollow noreferrer">Laravel Scout TNTSearch driver</a>.</p>
  
  <pre><code>php artisan tntsearch:import App\\MyModel
  </code></pre>
  
  <p>I want to call this command from my seeder. I've looked at the implementation, and it is complicated enough that I don't want to refactor, wait for a merged pull request, or copy-and-paste the implementation into my files.</p>
  
  <p>Inside the seeder I tried:</p>
  
  <pre><code>$this-&gt;call('tntsearch:import', ['model' =&gt; App\User::class]);
  </code></pre>
  
  <p>But <code>$this</code> refers to the seeder, and the <code>call</code> method is expecting another seeder, not a console command.</p>
  
  <p>I want to call the artisan command from inside my seeder.
  Is this possible?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I ended up doing this inside the seeder:</p>
  
  <pre><code>exec('php artisan tntsearch:import App\\User');
  </code></pre>
  
  <p>This works but feels dirty.  Is there another easy way without using <code>exec()</code>?</p>