dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.32k stars 1.25k forks source link

BindingResolutionException Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router]. #1415

Open fatkhanfauzi opened 7 years ago

fatkhanfauzi commented 7 years ago

I'm using Lumen 5.4 with the latest Dingo.

I have followed the installation procedure and also registered the class to bootstrap/app.php

$app->register(Dingo\Api\Provider\LumenServiceProvider::class);

But when i set route below it returns error

BindingResolutionException Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router].

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

$api->version('v1', function ($api) {

    $api->get('test', function () {
        return 'It is ok';
    });

});

Thanks.

iredmedia commented 7 years ago

Same issue for me in Laravel 5.4

lieroes commented 5 years ago

Same issue in Lumen 5.8 and Dingo\Api-2.0.0-beta1, how to solve it? Thank you!