Hello all,
I have a pre-existing application that I upgraded to Laravel 11. Now, I've been asked to prepare it for Octane (Swoole). From what I can see, only the following class might cause me issues:
class CompanyService
{
public static $company = null;
public static function setCompany(Company $company): void
{
self::$company = $company;
}
public static function getCompany(): ?Company
{
return self::$company;
}
}
Using a middleware, the application determines the active company by calling CompanyService::setCompany(). Then, whenever needed, it retrieves it using CompanyService::getCompany().
If this will cause problems with Octane, how can I adjust it, or what approach should I take?