Skip to content
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

Illuminate\Contracts\Container\BindingResolutionException: Target [CloudCreativity\JsonApi\Contracts\Http\Requests\RequestInterface] is not instantiable. #30

Closed
mk-conn opened this issue Nov 30, 2016 · 2 comments

Comments

@mk-conn
Copy link

mk-conn commented Nov 30, 2016

Could somebody explain me the reason why this could happen? I'm trying to integrate laravel-json-api in an existing project (switching from limoncello-collins, since he gave up developing for laravel...) . When I tried the demo-laravel-json-api project I had no problems.

@lindyhopchris
Copy link
Member

RequestInterface is only bound into the container if there is a valid JSON API request. This happens in the json-api middleware here:
https://github.com/cloudcreativity/laravel-json-api/blob/master/src/Http/Middleware/BootJsonApi.php#L82

Have you used the json-api middleware? It's intended for use in the route group that defines your resources, as per here in the demo app:
https://github.com/cloudcreativity/demo-laravel-json-api/blob/master/app/Http/Kernel.php#L51

@mk-conn
Copy link
Author

mk-conn commented Dec 1, 2016

Daaaamn.... Thanx for the middleware hint... I was running my (unit) tests with the WithoutMiddleware trait ... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants