What I want is just to use one controller at the moment which should handle every request that comes to my laravel 4 application. The problem is that none of the solutions on stackoverflow or elsewhere are working for me.
That's what i currently have:
Route::any('(.*)', function(){
return View::make('hello');
});
Now when browsing to the page I get an error everytime saying:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
Hope somebody could help me out!
The route:list command can be used to show a list of all the registered routes for the application. This command will display the domain, method, URI, name, action and middleware for the routes it includes in the generated table.
Route Parameters Laravel provides two ways of capturing the passed parameter: Required parameter. Optional Parameter.
The Default Route Files All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by your application's App\Providers\RouteServiceProvider . The routes/web.php file defines routes that are for your web interface.
Regular expressions are set as requirements and not directly in the route.
Route::any('{all}', function($uri)
{
return View::make('hello');
})->where('all', '.*');
Route::group(array('prefix' => '/', 'before' => 'MAKEYOUROWNFILTER'), function()
{
// your routers after the / ....
});
// and in filters.php
Route::filter('MAKEYOUROWNFILTER', function()
{
// do stuff or just
return View::make('hello');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With