保護された$ companyIDを作成しました。私の仕事のクラスで、その後__construct
機能で私が$id
を通過したが、私はクラスをインスタンス化する際にその後、私のhandler function
そのnull
Laravelのジョブでコンストラクタで渡した変数をインスタンス化する方法
protected $companyID = NULL;
public function __construct($ID) {
$this->companyID = $ID;
}
で変数をインスタンス化しようとすると?
$ProcessOutgoingSMS = new ProcessOutgoingSMS();
$ProcessOutgoingSMS->dispatch(3);
を注入したものは何でも、私がアクセスできるハンドル()関数で
のように見えますリンクhttps://laracasts.com/discuss/channels/general-discussion/how-do-you-pass-constructor-parameters-when-youre-instantiating-an-interface-through-a-bind –