我正在尝试翻译所有路线。我正在使用mcamara / laravel-localization包。我的路线看起来像这样:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
但我感到很恐怖:
语法错误,意外的'{'
什么错了?谢谢你的帮助!
答案 0 :(得分:1)
您可以从代码预览中看到颜色有问题。你必须删除第一行中的勾号(')...
在您完成转换后,您仍然遇到问题,现在我明白了原来的错误。
此
Route::get(LaravelLocalization::transRoute('routes.register_link') . '/{plan?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@showRegistrationForm']);
应该是按照您的预期创建路线的正确方法。
答案 1 :(得分:1)
获取
后还有一个'
Route::get(LaravelLocalization::transRoute('routes.register_link')/{plan?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@showRegistrationForm']);