laravel-angular-admin icon indicating copy to clipboard operation
laravel-angular-admin copied to clipboard

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

Open sandeepkundu4344 opened this issue 8 years ago • 5 comments

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.

sandeepkundu4344 avatar Sep 23 '16 11:09 sandeepkundu4344

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...

thomasmktong avatar Sep 25 '16 14:09 thomasmktong

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.

ramesh-tr avatar Oct 06 '16 17:10 ramesh-tr

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.

zbmowrey avatar Oct 06 '16 21:10 zbmowrey

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",

ramesh-tr avatar Oct 07 '16 16:10 ramesh-tr

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?

singhmohancs avatar Jun 08 '17 17:06 singhmohancs