Skip to content

[Suggestion/Question] Simplifying generation of URL's #1606

@jadonbrownza

Description

@jadonbrownza
Q A
Bug? no
New Feature? yes
Framework Laravel
Framework version 5.x.y
Package version 1.x.y
PHP version 7.x.y

Could the generation of URL's not be simplified using a Facade?

Currently we need to use:
app('Dingo\Api\Routing\UrlGenerator')->version('v1')->route('users.index');

This feels lengthly, from:
route('api.v1.users.index');

I'm thinking that something like this could be better:
DingoRoute('users.index') - Uses config.api.version to find the correct route in this case, or you could be more specific:
DingoRoute('users.index', 'v1')

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions