dingo / api

A RESTful API package for the Laravel and Lumen frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

php artisan api:routes error on laravel 8

cacing69 opened this issue · comments

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

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 laravel/framework@d9e28dc

commented

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?

#1771 (comment) refer to this, maybe no

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

commented

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

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