In Laravel v9/Octane/Swoole, I do have private properties in route controllers, e.g.
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
class SignupController extends Controller
{
/** @var ?\App\SignupCode A verification code object */
protected $code;
It looks like the property is "shared" between requests under Octane. I have more controllers like this. How do I make sure the controller state gets reset on every request? I've read the whole Octane documentation a few times, and it's still unclear how to do that.
I solved it by created listener
and add it to array of listeners in octane config
I do not know what the consequences may be, but so far it works well.