'Laravel/Octane: How to reset route controllers' state

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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source