Netson\L4gettext\L4gettext::createFolder PHP Method

createFolder() public method

method which auto creates the LC_MESSAGES folder for each set locale, if they do not exist yet
public createFolder ( string $path ) : L4gettext
$path string
return L4gettext
    public function createFolder($path)
    {
        // set full path
        $full_path = app_path() . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $this->getLocale() . DIRECTORY_SEPARATOR . 'LC_MESSAGES';
        // check if the folder exists
        if (!File::isDirectory($full_path)) {
            // folder does not exist, attempt to create it
            // throws an ErrorException when failed
            if (!File::makeDirectory($full_path, 0755, true)) {
                throw new LocaleFolderCreationException("The locale folder [{$full_path}] does not exist and could not be created automatically; please create the folder manually");
            }
        }
        // allow object chaining
        return $this;
    }