1

I was trying ti use Dingo package with Lumen. But unfortunately while setting up routes , its showing following error. Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router] error on Lumen

Please let me know if anyone has any solution.

Routes.php

$api = app('Dingo\Api\Routing\Router');


$api->version('v1', function($api){
    $api->get('users', function(){
       return 'test';
    });
});
Lakin Mohapatra
  • 1,097
  • 11
  • 22

2 Answers2

1

Thanks man:) After 4 years your solution is still useful:) It just needs a little modification.

$app->register(\Dingo\Api\Provider\LumenServiceProvider::class); in /bootstrap/app.php

It helped me with Lumen 7.0 and DingoApi 3.0.0

0

Finally I got the issue. I added Dingo\Api\Provider\LaravelServiceProvider::class at the end of bootstrap/app.php.

Thats why this issue has happened.

Fabien Sa
  • 9,135
  • 4
  • 37
  • 44
Lakin Mohapatra
  • 1,097
  • 11
  • 22