Skip to content

Is there a way to generate URL path by controller, action name and parameters? #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gvlasov opened this issue Apr 17, 2025 · 0 comments

Comments

@gvlasov
Copy link
Contributor

gvlasov commented Apr 17, 2025

With default Laravel routing, you can do

action([ProductsController::class, 'list'], ['page' => 1, 'filter' => 'blue'])

instead of using literal path like for example

/products/list/page/1/filter/blue

First variant allows direct navigation to the controller method in IDE and simplifies API refactoring.

Can something like this be done with this library? As far as I understand, the fact that the routes are generated and not declared with Route:: prevents from using the action([]) function.

@gvlasov gvlasov changed the title Is there a way to generate path by controller, action name and parameters? Is there a way to generate URL path by controller, action name and parameters? Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant