Skip to content
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

[future] Improve routing #2203

Open
aksiome opened this issue Mar 28, 2023 · 0 comments
Open

[future] Improve routing #2203

aksiome opened this issue Mar 28, 2023 · 0 comments
Labels
type: enhancement New feature or request

Comments

@aksiome
Copy link
Contributor

aksiome commented Mar 28, 2023

Summary

I think that the router should be reworked to allow new options (like uses) and match a bit more how resources work in laravel. The motivation for this came while developing a package where I had to manually register all routes because I needed a custom controller.

The idea is to allow both an options array and chained methods:

TwillRoutes::module('foo', ['uses' => 'foocontroller', 'only' => []])->except()->middleware()->parameters()->...

Also by not depending on resource routes and merging the resources_options array with the options array we could have more coherent urls and avoid having these 2 kind of patterns in nested modules:

  • posts/{post}/tests/{test}
  • posts/tests/duplicate/{id}

An other goal is to avoid registering useless routes. For example a singleton does not need the restore method or bulk actions.

I'm happy to work on a PR for it, I actually started one #2157 but I should not have pulled directly on 3.x without talking about it first and it's for sure something for a future update.

@ifox ifox added the type: enhancement New feature or request label Feb 10, 2024
@ifox ifox moved this to Beyond in Twill roadmap Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: Beyond
Development

No branches or pull requests

2 participants