-
-
Save bmadigan/d9ee520bf38aee1aa6d8 to your computer and use it in GitHub Desktop.
Hi. | |
I was doing the Multi-tenant tutorial and for some reason I keep getting the same error | |
over and over no matter what I do. | |
I've redone the code several times and still get the error: | |
Target [Illuminate\Database\Eloquent\Model] is not instantiable. | |
Which I understand should have something to do with my ServiceProviders and | |
binding them via the app.php file. | |
I have added you as a contributor to a private repo I have created to look at the | |
code if that's okay. | |
I re-created your /test route if you wish to see how I'm trying to call the Repository. | |
Any help would be great, been getting this error for a few days and I'm out of thoughts. | |
Thanks |
Hi Brad, where is your service provider? Renaku\Core\Providers\StartServiceProvider doesn't seem to exist?
Sorry about that. I thought I pushed it.
Where are you getting the error?
When I hit the StudentsRepository
I'm completely stumped by it. I've gone through the code for days over and over and I can't figure it out. I was a second pair of eyes that really the codebase might help
Its because you don't have a service provider to inject an instance of the Student
model into the repository. Laravel's IoC container is trying to resolve an instance of the abstract Model
class.
Set up a service provider to bootstrap your repository and inject an instance of the Student
model and it will work.
Beautiful !!! Got it working!! Thanks!! I knew another set of eyes would help
In the routes file, I do get the $client and I do get the $context properly, the error is when I try to call the StudentRepository itself.