0
votes

I've started to learn Laravel framework and faced with one problem. In this section they describe basic filter usage.

So, I put

Route::filter('old', function()
{
if (Input::get('age') < 200)
    {
        return Redirect::to('home');
    }
});

in app/filters

and

Route::get('user', array('before' => 'old', function()
{
     return 'You are over 200 years old!';
 }));

in /routes.php

I thought, that now I should call something like http://homestead.app/user/age/233 and script will return me "You are over 200 years old!", but I got Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException error msg instead.

Did I miss something?

1

1 Answers

1
votes

Input::get() fetches a parameter from the query string (GET) or form data (POST). You need to call:

homestead.app/user?age=233