Support the ongoing development of Laravel.io →
Configuration Requests

I have a real estate site and I want to have URL's for individual properties show up as /community/address so one may be:

http://mysite.com/delasol/12-Main-St/

I created a route that looks like this to test it out:

Route::get('{community}/{address}/', function($community, $address)
{
    echo "<p>Community: $community</p>";
    echo "<p>Address: $address</p>";
});

That does return delasol as the community and then 12-Main-St as the address.

But, what if I want to now have a blog and the URL's would be /blog/title-of-my-article.

My routing is going to make it think that blog is the community and title-of-my-article is the address! I'm new to Laravel and very confused as to how I would make this work.

Last updated 2 years ago.
0

I think you will have something like this

Route::get('blog/{article}/', function($article)
{
    echo "<p>Article: $article</p>";
});
Last updated 2 years ago.
0

ahmedmahmoudit said:

I think you will have something like this

Route::get('blog/{article}/', function($article)
{
   echo "<p>Article: $article</p>";
});

That works but I'm confused how that would integrate with Wordpress. If I install Wordpress under my /public folder, I don't see how I'm going to get the article to show up.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ChrisF79 chrisf79 Joined 11 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.