andersao / andersao/l5-repository

Is it possible to add repository without initialize at the controller constructor?

オープン
#381 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
4.2k
フォーク
880
PR マージ指標
30日以内にマージされた PR はありません

説明

I would like to add Repository at the constructor of Casperlaitw\LaravelFbMessenger\DefaultHandler, but it throws the error. Any solution?

The binding between ChatbotBlockRepository and ChatbotBlockRepositoryEloquent is success, and it works in Normal Controller constructor.

``` php
Target [App\\Models\\Repositories\\ChatbotBlockRepository] is not instantiable while building [App\\Contracts\\ChatbotDefaultHandler].
```

``` php
blockRepo = $blockRepo;
}

/**
* handle method is required.
*/
public function handle(ReceiveMessage $message)
{
\Log::debug('Received Message: ', (array) $message);

$this->send(new Text($message->getSender(), "Default Handler: {$message->getMessage()}"));
//$this->send(new Text($message->getSender(), $action->message));


}
}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。