Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

Hello, I use a language prefix in my routing like this:

Route::get('/', function(){
    return Redirect::to('/nl'):
});

Route::group(array('prefix' => '{language}', function() {});

After handling my contactformrequest I want to redirect to this page:

www.test.com/nl/contact

But instead I get

www.test.com/%7Blanguage%7D/contact

Then I tried to pass the prefix in my formhandler as a parameter but without success

public function send(ContactFormRequest $request, $language)
{
    return \Redirect::action('SiteController@contact', array('language' => $language)
        ->with('message', 'Thank you for contacting us!');
}

A dd($language) gives me "{language}"

If I'm not mistaken it was not possible with basic routing in Laravel 4 but can it be done in 5?

Thx

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bflydesign bflydesign Joined 21 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.