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;
}