-1

I'm trying to translate all routes. I'm using mcamara/laravel-localization package. My route looks like that:

    // Registration Routes...
Route::get(LaravelLocalization::transRoute('routes.register_link')/{plan?}, ['as' => 'auth.register', 'uses' => 'Auth\AuthController@showRegistrationForm']);
Route::post(LaravelLocalization::transRoute('routes.register_link'), ['as' => 'auth.register', 'uses' => 'Auth\AuthController@postRegister']);

But i'm getting eror:

syntax error, unexpected '{'

Whats wrong? Thanks for help guys!

  • Possible duplicate of [PHP Parse/Syntax Errors; and How to solve them?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – u_mulder Mar 01 '17 at 07:47

2 Answers2

1

You can see from the code preview that something is wrong with the colors. You have a tick ( ' ) in the first line you have to remove...


After you made the change over, you still have an issue and now I understood what was originally wrong.

This

Route::get(LaravelLocalization::transRoute('routes.register_link') . '/{plan?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@showRegistrationForm']);

should be the right way to create the route as you expected.

Simone Cabrino
  • 901
  • 9
  • 24
1

There is an extra ' after get

Route::get(LaravelLocalization::transRoute('routes.register_link')/{plan?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@showRegistrationForm']);
StateLess
  • 5,344
  • 3
  • 20
  • 29