laravel-angular-admin
laravel-angular-admin copied to clipboard
Call to undefined method Dingo\Api\Routing\Router::controller()
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.
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...
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.
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.
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",
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?