ValetDriver::driversIn PHP Method

driversIn() public static method

Get all of the driver classes in a given path.
public static driversIn ( string $path ) : array
$path string
return array
    public static function driversIn($path)
    {
        if (!is_dir($path)) {
            return [];
        }
        $drivers = [];
        foreach (scandir($path) as $file) {
            if ($file !== 'ValetDriver.php' && strpos($file, 'ValetDriver') !== false) {
                require_once $path . '/' . $file;
                $drivers[] = basename($file, '.php');
            }
        }
        return $drivers;
    }