Api: php artisan api:routes error on laravel 8

Created on 1 Mar 2021  路  18Comments  路  Source: dingo/api

| Q | A
| ----------------- | ---
| Bug? | yes
| New Feature? | no
| Framework | Laravel
| Framework version | 8.12
| Package version | 3.0.5
| PHP version | 7.4.15

Actual Behaviour

i got error when use command php artisan api:route

Expected Behaviour

it must show route api list
image

Most helpful comment

Thanks a lot, it fixed everything. Are you going to make a PR @gonpre?

yes, I already did, hope this could be merged soon

i will close this issue when yout PR has been merged

All 18 comments

me too.
Framework version 8.28.0

v8.28.0
Fixed
Fix undefined property with sole query (#36216)
Resolving non-instantiables corrupts Container::$with (#36212)
Fix attribute nesting on anonymous components (#36240)
Ensure $prefix is a string (#36254)
Add missing import (#34569)
Align PHP 8.1 behavior of e() (#36262)
Ensure null values won't break on PHP 8.1 (#36264)
Handle directive $value as a string (#36260)
Use explicit flag as default sorting (#36261)

Fix middleware group display (d9e28dc)

me too.

getting same error

me too

same here

but php artisan route:list, work for me,

The issue is caused by the change done in this commit https://github.com/laravel/framework/commit/d9e28dcb1f4a5638b33829d919bd7417321ab39e

The issue is caused by the change done in this commit laravel/framework@d9e28dc

so how do we resolve this?

The issue is caused by the change done in this commit laravel/framework@d9e28dc

so how do we resolve this?

What I did was to add this code:

    /**
     * Flush the router's middleware groups.
     *
     * @return $this
     */
    public function flushMiddlewareGroups()
    {
        return $this;
    }

on the file vendor/dingo/api/src/Routing/Router.php to be able to run the api:routes command.

Thanks a lot, it fixed everything. Are you going to make a PR @gonpre?

Thanks a lot, it fixed everything. Are you going to make a PR @gonpre?

yes, I already did, hope this could be merged soon

Thanks a lot, it fixed everything. Are you going to make a PR @gonpre?

yes, I already did, hope this could be merged soon

i will close this issue when yout PR has been merged

Will this ever be merged?

Will this ever be merged?

no idea, meanwhile I changed my composer file to use my repo with the fix instead, maybe this will help you too

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/gonpre/api"
        }
    ],
    "require": {
        "dingo/api": "dev-bugfix/1770_api_routes_error_laravel_8",

Will this ever be merged?

https://github.com/dingo/api/pull/1771#issuecomment-811459676 refer to this, maybe no

Same issue here. Its stupid that such errors might occur, why Laravel does not provide any interface for router?

Hey guys, this fix is merged and tagged, thanks for your patience.

https://github.com/dingo/api/releases/tag/v3.0.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhayiwg picture jhayiwg  路  3Comments

yaoshanliang picture yaoshanliang  路  4Comments

MicroDroid picture MicroDroid  路  3Comments

adrian-fjellberg picture adrian-fjellberg  路  4Comments

jdforsythe picture jdforsythe  路  3Comments