Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic urls in laravel?
    primarykey
    data
    text
    <p>I am looking at <a href="http://laravel.com" rel="noreferrer">switching to laravel</a> for my next project.</p> <p>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.</p> <p>What I am curious about is how I can manage dynamic routes in Laravel.</p> <p>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. <a href="http://domain.com/when-it-started" rel="noreferrer">http://domain.com/when-it-started</a> I do not want to have to create a new controller or route manually for each page.</p> <p>So I am wondering what the cleanest way is to handle this.</p> <p>essentially all static pages are going to share the same view, just a few variables to change.</p> <p>The dynamic routing should work <em>with</em> the controllers not instead of.</p> <p>E.g. if we have a controller <code>about</code> with a function <code>staff</code> then this should be loaded via <a href="http://domain.com/about/staff" rel="noreferrer">http://domain.com/about/staff</a></p> <p>but we dont have the function <code>players</code>, so a call to <a href="http://domain.com/about/players" rel="noreferrer">http://domain.com/about/players</a> 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 <code>when-it-started</code> controller!)</p> <p>The chosen answer doesn't seem to work in Laravel 4. Any help with that?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload