Does anyone know if it is possible to get the active site from the boot() method of a custom plugin in the Plugin.php file?
Whatever I do, I always get back the primary site, instead of the site the user is currently on.
public function boot()
{
$activeSite = Site::getActiveSite();
Log::info('Active site: '.$activeSite->code);
}
My goal is to have a link to a specific product on a specific subsite, but with a variable locale, so I can reuse that as a variable in pages and emails without duplicate code.