diff --git a/src/RestoreCurrentSite.php b/src/RestoreCurrentSite.php new file mode 100644 index 0000000..eee4146 --- /dev/null +++ b/src/RestoreCurrentSite.php @@ -0,0 +1,30 @@ +siteHandle = Site::current()->handle(); + } + + public function hydrateRestoreCurrentSite(): void + { + Site::setCurrent($this->siteHandle); + + $site = Site::current(); + + setlocale(LC_TIME, $site->locale()); + app()->setLocale($site->lang()); + Date::setToStringFormat(Statamic::dateFormat()); + } +}