Api: Command api:routes only shows Clouse under the Action column.

Created on 16 Aug 2016  路  4Comments  路  Source: dingo/api

Maybe this line should use uses instead of controller
https://github.com/dingo/api/blob/master/src/Routing/Route.php#L525

enhancement

Most helpful comment

@adrian-fjellberg Will aim to get this in before version 1.0.0

All 4 comments

@adrian-fjellberg Are you saying the api:routes command is not showing routes that are defined using controllers? Or that even if its defined with a controller, it still shows Closure?

This might only be a problem when registering resource routes (ie. $api->resource(..)). The reason this is a problem is that the ResourceRegistar class in this package extends the Illuminate\Routing\ResourceRegistrar, and as you can se from this line the Illuminate class specifies the uses keyword only and not the controller keyword. So when registering an API resource the api:routes command does not have a controller key for the routes registed by the $api->resource(..) and therefore only returns Closure. I think this can be fixed if the getActionName method does a search for the uses key if it cannot find the controller key.

@adrian-fjellberg Will aim to get this in before version 1.0.0

Closed via 402680c

Was this page helpful?
0 / 5 - 0 ratings