Reputation: 833
I'd really like to be able to use Laravel (3) and have dashes as url separators rather than underscores.
I'd like to be able to do this automatically rather than having to define a new route for every_single_page too.
I can't see how to achieve this, and make sure that Laravel works as normal at the same time.
Any help would be really gratefully received!
Upvotes: 3
Views: 3638
Reputation: 2546
I've created pull request to the 3.x branch that fixes this issue.
You can use both patch or my still-supported fork of 3.x branch of the framework.
Upvotes: 2
Reputation: 4145
Just use :
return Str::slug('My First Blog Post!');
It will echo a link like mypage/my-first-blog-post
You can also be more precise :
return Str::slug('My First Blog Post!', '_');
Will give mypage/my_first_blog_post
Upvotes: 4