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

[Suggestion] Ability to customize url format #167

Closed
tomschlick opened this issue Sep 18, 2016 · 5 comments
Closed

[Suggestion] Ability to customize url format #167

tomschlick opened this issue Sep 18, 2016 · 5 comments

Comments

@tomschlick
Copy link
Contributor

Instead of /blog/{slug} I'd like to use /{year}/{month}/{day}/{slug}. As far as I can see, I can change the path in the routes/web.php file but that doesn't persist through the site because you're not using Laravel's named routes.

I can come up with a PR for this if you'd like. Basically my approach would be this:

  1. Name all the routes instead of using the hardcoded slugs.
  2. In Frontend\BlogController@showPost, accept any of the following as parameters (slug, year, month, day, post id, etc). When present, all will be used as where() conditions when finding the post.

From there all someone has to do is customize the routes file and it should just work. There might be a few more things to this later down the road related to #95 and upgrading but I don't think it's something that would be too hard to work past.

Thoughts?

@austintoddj
Copy link
Owner

@tomschlick I like that idea a lot. Would users still retain the ability to edit their post slugs? That came into play as users in other countries had language difficulties that necessitated the request for editing slugs. If that will still be the same, then I see no reason why we can't merge in a PR doing what you propose.

@tomschlick
Copy link
Contributor Author

Yeah I don't see any reason why that wouldn't work. The route wouldn't care what the slug was, it just passes it back to the controller to parse & query the database.

I'll probably create this as two PRs. One for the named routes and another for the url params.

@joelstahre
Copy link

joelstahre commented Jan 24, 2017

What is the status for this?
I would really like to be able to have the url like:

www.myblog.com/my-post1
www.myblog.com/my-post2

etc..

i have seen that there has been some discussion about it, but is it still ongoing?

@austintoddj
Copy link
Owner

@joelstahre Yes, this is still a feature being developed on. Will let you know more as soon as possible.

@austintoddj
Copy link
Owner

First off, thanks for taking the time to create the issue. Closing because everything v3.x related will remain as-is and won’t receive anymore updates. The next release is slated for this week, so stay tuned!

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

Successfully merging a pull request may close this issue.

3 participants