Api: laravel5.5 : Call to undefined method Illuminate\Routing\Route::getUri()

Created on 4 Sep 2017  ·  9Comments  ·  Source: dingo/api

when I update laravel 5.4 to 5.5 ,it returned.

[2017-09-03 17:13:05] local.ERROR: Call to undefined method Illuminate\Routing\Route::getUri() {"userId":1,"email":"[email protected]","exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to undefined method Illuminate\Routing\Route::getUri() at /Users/north/www/fdb/vendor/dingo/api/src/Routing/Adapter/Laravel.php:98)
[stacktrace]

0 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Route.php(158): Dingo\Api\Routing\Adapter\Laravel->getRouteProperties(Object(Illuminate\Routing\Route), Object(Dingo\Api\Http\Request))

1 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Route.php(148): Dingo\Api\Routing\Route->setupRouteProperties(Object(Dingo\Api\Http\Request), Object(Illuminate\Routing\Route))

2 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Router.php(696): Dingo\Api\Routing\Route->__construct(Object(Dingo\Api\Routing\Adapter\Laravel), Object(Illuminate\Foundation\Application), Object(Dingo\Api\Http\Request), Object(Illuminate\Routing\Route))

3 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Router.php(674): Dingo\Api\Routing\Router->createRoute(Object(Illuminate\Routing\Route))

4 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Router.php(636): Dingo\Api\Routing\Router->getCurrentRoute()

5 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Router.php(606): Dingo\Api\Routing\Router->requestIsConditional()

6 /Users/north/www/fdb/vendor/dingo/api/src/Routing/Router.php(572): Dingo\Api\Routing\Router->prepareResponse(Object(Dingo\Api\Http\Response), Object(Dingo\Api\Http\Request), 'json')

7 /Users/north/www/fdb/vendor/dingo/api/src/Http/Middleware/Request.php(112): Dingo\Api\Routing\Router->dispatch(Object(Dingo\Api\Http\Request))

8 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Dingo\Api\Http\Middleware\Request->Dingo\Api\Http\Middleware\{closure}(Object(Dingo\Api\Http\Request))

9 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))

10 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Dingo\Api\Http\Request), Object(Closure))

11 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))

12 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Dingo\Api\Http\Request), Object(Closure))

13 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))

14 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Dingo\Api\Http\Request), Object(Closure))

15 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))

16 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Dingo\Api\Http\Request), Object(Closure))

17 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))

18 /Users/north/www/fdb/vendor/dingo/api/src/Http/Middleware/Request.php(113): Illuminate\Pipeline\Pipeline->then(Object(Closure))

19 /Users/north/www/fdb/vendor/dingo/api/src/Http/Middleware/Request.php(89): Dingo\Api\Http\Middleware\Request->sendRequestThroughRouter(Object(Dingo\Api\Http\Request))

20 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Dingo\Api\Http\Middleware\Request->handle(Object(Dingo\Api\Http\Request), Object(Closure))

21 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

22 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

23 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))

24 /Users/north/www/fdb/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

25 /Users/north/www/fdb/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

26 {main}

"}

Most helpful comment

Hi @Broutard here is my solution if you haven't found one yet...

In composer.json update the dingo dependencies to
"dingo/api": "1.0.0-beta8", "dingo/blueprint": "dev-master",

And then add this so that the master branch of this fork is used ie "dingo/blueprint": "dev-master"

"repositories": [ { "type": "vcs", "url": "https://github.com/Reddok/blueprint.git" } ],

All 9 comments

Make sure you are using beta8, it fixes the issue. The main problem is in fact to do with dingo/blueprint which is required by the api but does not have Laravel 5.5 as a dependency.

@albofish it doesn't work :

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove laravel/framework v5.5.2
    - Installation request for dingo/api 1.0.0-beta8 -> satisfiable by dingo/api[v1.0.0-beta8].
    - Conclusion: don't install laravel/framework v5.5.2
    - Conclusion: don't install laravel/framework v5.5.1
    - dingo/api v1.0.0-beta8 requires dingo/blueprint 0.2.* -> satisfiable by dingo/blueprint[0.2.2, v0.2.0, v0.2.1].
    - dingo/blueprint 0.2.2 requires illuminate/filesystem 5.1.* || 5.2.* || 5.3.* || 5.4.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - dingo/blueprint v0.2.0 requires illuminate/filesystem 5.1.* || 5.2.* || 5.3.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - dingo/blueprint v0.2.1 requires illuminate/filesystem 5.1.* || 5.2.* || 5.3.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - don't install illuminate/filesystem v5.4.0|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.13|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.17|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.19|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.27|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.36|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.4.9|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.1|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.13|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.16|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.2|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.20|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.22|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.25|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.28|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.30|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.31|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.41|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.6|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.1.8|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.0|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.19|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.21|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.24|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.25|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.26|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.27|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.28|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.31|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.32|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.37|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.43|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.45|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.6|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.2.7|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.3.0|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.3.16|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.3.23|don't install laravel/framework v5.5.0
    - don't install illuminate/filesystem v5.3.4|don't install laravel/framework v5.5.0
    - Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, v5.5.2].

"dingo/blueprint": "0.2.*" is required in all versions.

See my previous comment. The issue is with dingo/blueprint not dingo/api

Yes but beta8 don't solve this issue.

Hi @Broutard here is my solution if you haven't found one yet...

In composer.json update the dingo dependencies to
"dingo/api": "1.0.0-beta8", "dingo/blueprint": "dev-master",

And then add this so that the master branch of this fork is used ie "dingo/blueprint": "dev-master"

"repositories": [ { "type": "vcs", "url": "https://github.com/Reddok/blueprint.git" } ],

Hi @plexus77, following your instruction results to following errors:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Can only install one of: dingo/api[v1.0.0-beta8, 1.0.x-dev].
- Can only install one of: dingo/api[v1.0.0-beta8, 1.0.x-dev].
- Installation request for dingo/api 1.0.0-beta8 -> satisfiable by dingo/api[v1.0.0-beta8].
- Installation request for dingo/api 1.0.x-dev -> satisfiable by dingo/api[1.0.x-dev].

As I said in an other message

I forked the projects (api and blueprint). I use those forks in my composer.json and it works with Laravel 5.5.

Simply add

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/BafS/api"
        },
        {
            "type": "vcs",
            "url": "https://github.com/BafS/blueprint"
        }
    ],

in your composer file and update.

升级到"dingo/api:1.0.0-beta8" 也还是报这个错

Was this page helpful?
0 / 5 - 0 ratings