Thursday, 5 September 2013

How do I define a default fallback route in Laravel?

How do I define a default fallback route in Laravel?

I'm currently upgrading a custom CMS from Laravel 3 to Laravel 4 (this
upgrade is important for various reasons).
In the existing version, it has routing set up so that routes can be
individually defined--but if someone tries to load a route that is not
specifically defined, the system catches it and sends it to a "page
processor"--which essentially checks to see if the CMS page/post exists in
the database.
The "fallback" or "default" route processing line in Laravel 3 looked like
this:
Route::get('(.*)', array('uses' => 'myPageLoading@method'));
My problem is that this syntax is not supported in Laravel 4. How do I do
this in Laravel 4?

No comments:

Post a Comment