-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Artisan::resolve() - 4.1 #2881
Comments
What are you binding to your interface and where are you binding it ? |
Using a bindings.php separate file loaded in app/start/globals.php
To bind the interface to the concrete class:
Also tried to put this in routes file. Also tried to use the concrete class instead of the interface. |
Where do you add the command? |
Yes! |
Have you tried a |
Also maybe try a fresh |
Did that too, while trying to figure out. There's something I think might help understand it better: trying to instantiate the concrete class in artisan.php
Gives the same error: PHP Fatal error: Class 'App\DataRepository' not found in /application.dve/app/start/artisan.php on line 14 I was trying to instantiate it and pass to App::add(). |
Your fatal error says class "App\DataRepository" instead of "App\Repositories\DataRepository"...? |
Was a typo. I'm actually editing the error, to not expose application name: This is it unedited: removed |
Are you able to paste the real, unedited bindings as well, and an unedited command file? |
full bindings: removed |
Where do these files live? What is the file structure like? What is your composer.json file? |
And full artisan.php removed |
This is the controller that works fine:
|
Hmm, I totally confused as to why this wouldn't be working then. Can you set a debug statement to make sure your binding is registered? |
Another strange thing that happens in the process, looks like it finds the dependency, but just prints it out in the terminal: |
The top of that file has no php... just <? |
Can you paste that whole interface file? |
Gosh, that was dumb. It was just a missing php after <?. That one and anoter 10 other files where I just copied and pasted the namespace... But why was that working in the first place? Sorry. |
No prob. |
This is what I have:
Adding the command to Artisan via resolve():
The Command:
Trying to use the command gives me this error:
But I also have this controller where the same resolution works fine:
Without the dependency command works fine.
Am I doing something wrong or it's a bug?
The text was updated successfully, but these errors were encountered: