Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Call to undefined method Dingo\Api\Routing\Router::controller() #75

Open
sandeepkundu4344 opened this issue Sep 23, 2016 · 5 comments
Open

Comments

@sandeepkundu4344
Copy link

Project runs successful but when I integrate Laravel Cashier (https://laravel.com/docs/5.2/billing) it starts giving me error

FatalErrorException in routes.php line 24: Call to undefined method Dingo\Api\Routing\Router::controller()

I tried with composer update or install but nothing helped.

@thomasmktong
Copy link
Contributor

thomasmktong commented Sep 25, 2016

I am not familiar with this but I am interested to know too.

It seems to me that Dingo API is not compatible with Laravel Cashier, perhaps can check with them: https://github.com/dingo/api/wiki/Package-Incompatibilities

and I think we may need to use other libraries (e.g. Stripe JS API https://stripe.com/docs/custom-form) instead of Cashier since we are not doing Laravel full stack...

@ramesh-tr
Copy link

ramesh-tr commented Oct 6, 2016

Update: Sorry, this suggestion is incorrect!!!

Replacing $api->controller(...) with $api->resource(...) in routes.php fixed the issue for me. Does it sound like a good solution for this?

Note: I got this issue after I do a "composer update". Composer update itself failed when executing the command "php artisan clear-compiled". I guess, composer updated some libraries automatically.

@zbmowrey
Copy link
Contributor

zbmowrey commented Oct 6, 2016

THANK YOU for this. I tried a composer update and got the exact same issue. Knowing that this will resolve is a big help in keeping the stack up-to-date.

@ramesh-tr
Copy link

ramesh-tr commented Oct 7, 2016

Sorry! The suggestion I made to replace controller to resource in routes.php is incorrect.

I found the root cause of this problem. It's with dingo/api package. v1.0.0-beta6 is with laravel 5.3, and is not compatible with the version of Laravel of this project.

Replace the version number of dingo/api in composer.json to 1.0.0-beta5 resolves this issue.
"dingo/api": "1.0.0-beta5@dev",

@singhmohancs
Copy link

I am facing the same issue. I have run composer update command and start giving this error.

I try with $api->controller(...) with $api->resource(...) now i am getting 405 Method Not Allowed

Can anybody help on this?

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

No branches or pull requests

5 participants