title: Invalid argument supplied for foreach() in Laravel Schedular Job
body: <p>I'm working with <code>Schedular</code> in <code>Laravel 5.8</code>. after setting up the <code>Commands</code> and <code>Command Kernal</code> I'm getting the error as,</p>
  
  <blockquote>
    <p>Invalid argument supplied for foreach() at /home/SERVER_USER_NAME/public_html/vendor/symfony/console/Input/ArgvInput.php:261)</p>
  </blockquote>
  
  <p>Here is the <code>Kernal</code> methods,</p>
  
  <pre class="lang-php prettyprint-override"><code>protected $commands = [
      Commands\OfferMonitor::class,
      Commands\RankingCommand::class,
      Commands\CreditCycle::class,
  ];
  
  protected function schedule(Schedule $schedule)
  {
      $schedule-&gt;command('KG:OfferMonitor')-&gt;dailyAt('01:00');
      $schedule-&gt;command('KG:UpdateRanks')-&gt;everyTenMinutes();
      $schedule-&gt;command('KG:CreditCycle')-&gt;dailyAt('00:00');
  }
  </code></pre>
  
  <p>Here is my <code>Laravel Cron Job</code> running on production server,
  <a href="https://i.stack.imgur.com/SiObS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SiObS.png" alt="Cron Job"></a></p>
  
  <p>I think the cron job itself throws an error, I'm using <code>php</code> binary instead of <code>php-cli</code>. Does it caused error? if yes, what's the workaround to this issue?</p>
  
  <p>Here is the complete error log and stacktrace from Laravel,</p>
  
  <pre><code>Invalid argument supplied for foreach() {"exception":"[object] (ErrorException(code: 0): Invalid argument supplied for foreach() at /home/SERVER_USER_NAME/public_html/vendor/symfony/console/Input/ArgvInput.php:261)
  [stacktrace]
  #0 /home/SERVER_USER_NAME/public_html/vendor/symfony/console/Input/ArgvInput.php(261): Illuminate\\Foundation\\Bootstrap\\HandleExceptions-&gt;handleError(2, 'Invalid argumen...', '/home/SERVER_USER_NAME...', 261, Array)
  #1 /home/SERVER_USER_NAME/public_html/vendor/symfony/console/Application.php(970): Symfony\\Component\\Console\\Input\\ArgvInput-&gt;getFirstArgument()
  #2 /home/SERVER_USER_NAME/public_html/vendor/laravel/framework/src/Illuminate/Console/Application.php(81): Symfony\\Component\\Console\\Application-&gt;getCommandName(Object(Symfony\\Component\\Console\\Input\\ArgvInput))
  #3 /home/SERVER_USER_NAME/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\\Console\\Application-&gt;run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
  #4 /home/SERVER_USER_NAME/public_html/artisan(36): Illuminate\\Foundation\\Console\\Kernel-&gt;handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
  #5 {main}
  "}
  </code></pre>
  
  <blockquote>
    <p>Note: The <code>Commands</code> scheduled in <code>Kernal.php</code> is running properly when I use them with <code>artisan</code> from terminal, so there is no issue about command.</p>
  </blockquote>