【发布时间】:2020-04-17 12:20:05
【问题描述】:
我正在使用 Laravel,并且我已经将所有路由都用于仪表板 所以我想用这样的 url 改变语言:
http://localhost:8000/ar/dashboard/shop/dashboard-shop http://localhost:8000/fa/dashboard/shop/dashboard-shop http://localhost:8000/en/dashboard/shop/dashboard-shop
Route::namespace('Dashboard')->prefix('{locale}/dashboard')-
>middleware('auth')->group(function ($locale) {
.
.
.
.
.
}
但它没有将 $locate 作为字符串 "en" 或 "fa" 它给了我这个对象
Illuminate\Routing\Router {#26 ▼
#events: Illuminate\Events\Dispatcher {#27 ▶}
#container: Illuminate\Foundation\Application {#2 ▶}
#routes: Illuminate\Routing\RouteCollection {#29 ▶}
#current: null
#currentRequest: null
#middleware: array:9 [▶]
#middlewareGroups: array:2 [▶]
+middlewarePriority: array:6 [▶]
#binders: []
#patterns: []
#groupStack: array:2 [▶]
}
【问题讨论】:
标签: php laravel localization