<?php

namespace App\Providers\DirGenerator;

class DirGenerator
{
    public function createDirectoryByMonth($privatePath, $path, $prefix)
    {
        $directory = $path . DIRECTORY_SEPARATOR . $prefix . date('ym');
        $dirPath = $privatePath . $directory;

        if (!is_dir($dirPath)) {
            @mkdir($dirPath, 0700);
        }
        return $directory;
    }
}
