I'm using a Model observer to create related entries on the Model's created event. I'm using this repository package to communicate with my database. I bind the RepositoryInterfaces to their concrete classes in my RepositoryServiceProvider, which I added to the 'providers' array in my config/app.php. When my Observer runs, however, I get the following error:
Target [App\Repositories\Interfaces\ExamAttemptQuestionRepositoryInterface] is not instantiable while building [App\Observers\ExamAttemptObserver].
I've created a little test interface MyInterface, implemented it in MyClass and bound the interface to the implementation in my RepositoryServiceProvider, just like I did with all my other repositories. The observer doesn't throw an exception when I resolve MyInterface in the constructor.
interface MyInterface
{
public function test(): string;
}
I've raised an issue on Laracasts, but was hoping to also get help from here, since I'm unsure if where the issue originates.
Hi,
I'm using a Model observer to create related entries on the Model's
created
event. I'm using this repository package to communicate with my database. I bind the RepositoryInterfaces to their concrete classes in myRepositoryServiceProvider
, which I added to the'providers'
array in myconfig/app.php
. When my Observer runs, however, I get the following error:I've created a little test interface
MyInterface
, implemented it inMyClass
and bound the interface to the implementation in myRepositoryServiceProvider
, just like I did with all my other repositories. The observer doesn't throw an exception when I resolveMyInterface
in the constructor.I've raised an issue on Laracasts, but was hoping to also get help from here, since I'm unsure if where the issue originates.
Kinds regards,