Laravel框架中的路线

code:

Route::get('/contact', array(
   'as' => 'action-contact',
   'uses' => 'HomeController@actionContact',
));

now, when visit: localhost/laravel/public/contact - it work. But, when visit: localhost/laravel/public/contact/ - it not working. It redirect to localhost/contact what's problem? somebody can help me?

This is not exactly a Laravel problem, it's something that should be handled by your webserver. If your webserver is Apache, check if you have mod_rewrite installed and enabled, because Laravel solves that in .htaccess:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

The line:

RewriteRule ^(.*)/$ /$1 [L,R=301]

Tells apache to rewrite anything that ends with a slash

localhost/laravel/public/contact/

to

localhost/laravel/public/contact