Laravel parent class 属性 继承问题

Laravel parent class property inheritance problem

在 laravel 中,我有一个 child class(为清楚起见缩短了代码):

<?php

namespace App\Http\Controllers\Auth;

class RegisterController extends Controller {
    ...
    protected function create(array $data)
    {
        $twilio = new Client($this->sid, $this->authToken);

        $user = $twilio->chat->v2->services(env("TWILIO_CHAT_SERVICE_SID"))
                ->users
                ->create($data['username']);

    }
    ...
}

我有 parent class:

<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    public $sid;
    public $authToken;
    public $serviceId;

    public function __construct()
    {
        $this->sid = getenv("TWILIO_ACCOUNT_SID");
        $this->authToken = getenv("TWILIO_AUTH_TOKEN", true);
        $this->serviceId = getenv("TWILIO_CHAT_SERVICE_SID");

    }
}

我仍然收到此错误:

"message": "Argument 1 passed to Twilio\Rest\Chat\V2\ServiceList::getContext() must be of the type string, null given, called in /home/fingxtbh/thisnthat.com/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2.php on line 80",
"exception": "TypeError",
"file": "/home/fingxtbh/thisnthat.com/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceList.php",
"line": 131,
"trace": [
    {
        "file": "/home/fingxtbh/thisnthat.com/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2.php",
        "line": 80,
        "function": "getContext",
        "class": "Twilio\Rest\Chat\V2\ServiceList",
        "type": "->"
    },
    {
        "file": "/home/fingxtbh/thisnthat.com/app/Http/Controllers/Auth/RegisterController.php",
        "line": 104,

为什么不能从 parent class 正确读取变量 $this->serviceId?

env调用不应该是这样的吗?

public function __construct()
{
    parent::__construct();

    $this->sid = env("TWILIO_ACCOUNT_SID");
    $this->authToken = env("TWILIO_AUTH_TOKEN", true);
    $this->serviceId = env("TWILIO_CHAT_SERVICE_SID");

}