title: sendOutputTo in Laravel Console
body: <p>I scheduled a cronjob through Laravel console. It is working and giving the result in every minute. But I tried to write the output to a file using the <code>sendOutputTo</code> and <code>appendOutputTo</code> method. But this is not writing to the file. My file has write permission.</p>
  
  <p>Below is my code:</p>
  
  <p><strong>Kernel.php</strong></p>
  
  <pre><code>protected function schedule(Schedule $schedule) {
  
    $filePath = base_path() . "\cron\CleanSession.txt";
  
    $schedule-&gt;command('cleansession')
             -&gt;everyMinute()
             -&gt;sendOutputTo($filePath);
  }
  </code></pre>
  
  <p><strong>Session.php</strong></p>
  
  <pre><code>public function handle() {
  
          $this-&gt;info('Display this on the screen');
          $onlineCodeObj = new OnlineCode();
          if ($onlineCodeObj-&gt;cleanSession()) {
              echo "SESSION CLEANED : echo" . "\n";
              return "SESSION CLEANED: return" . "\n";
          }
           echo "SESSION CLEANED : echo2" . "\n";
           return "SESSION CLEANED: return2" . "\n";
      }
  </code></pre>