I am looking at switching to laravel for my next project.
My next project is probably going to be a small site with a few static pages, a blog and a projects manager and will be using controllers not routes.
What I am curious about is how I can manage dynamic routes in Laravel.
Basically, I want to build in an admin section so I can easily create the static pages on the fly, and the static pages will have SEO focussed urls, e.g. http://domain.com/when-it-started I do not want to have to create a new controller or route manually for each page.
So I am wondering what the cleanest way is to handle this.
essentially all static pages are going to share the same view, just a few variables to change.
The dynamic routing should work with the controllers not instead of.
E.g. if we have a controller about
with a function staff
then this should be loaded via http://domain.com/about/staff
but we dont have the function players
, so a call to http://domain.com/about/players should check the database to see if a dynamic route exists and matches. If it does display that, otherwise show the 404 page. Likewise for a non-existant controller. (e.g. there would not be a when-it-started
controller!)
The chosen answer doesn't seem to work in Laravel 4. Any help with that?