andersao / andersao/l5-repository

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

Aberta
#381 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
PHP
Estrelas
4.2k
Forks
880
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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));


}
}
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.