Recca0120\Terminal\Console\Commands\Tail::fire PHP Method

fire() public method

fire.
public fire ( )
    public function fire()
    {
        $path = $this->argument('path');
        $lines = $this->option('lines');
        if (empty($path) === false) {
            $path = $this->getLaravel()->basePath() . '/' . $path;
        } else {
            $path = $this->getLaravel()->storagePath();
            $files = array_filter($this->filesystem->glob($path . '/logs/*.log'), function ($file) {
                return is_file($file);
            });
            usort($files, function ($a, $b) {
                $aTime = filectime($a);
                $bTime = filectime($b);
                if ($aTime == $bTime) {
                    return 0;
                }
                return $aTime < $bTime ? -1 : 1;
            });
            $path = $files[0];
        }
        $this->readLine($path, $lines);
    }