0

I have following implicit route defined (Laravel 5.2)

// Handle locale
Route::group([
    'prefix' => '{country}/{language}',
], function () {
    Route::controller('user', 'UserController');
});

And here is my controller

class UserController extends BaseLocaleController
{
  public function getIndex()
  {
    return view('user/index');
  }

  public function getProfile($slug)
  {
    echo $slug;die;
    return view('user/view');
  }
}

My URI Structure is

http://{host}/in/en/user/profile/manju

The problem here, my slug value is in instead of manju. Is there any URI pattern I need to apply?

How can make this work in Laravel 5.2. As you could see, I have country and language prefix in Route::group.

1 Answer 1

2

Just pass the $country, $language to the method

So it should be

 public function getProfile($country, $language, $slug)
  {
    echo $slug;die;
    return view('user/view');
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.