我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel Localization在api.php路由中不起作用

I have some problem with my Laravel 5.6 project. I have created all my routes in api.php but the localization is not working.

When I create the routes in web.php the localization is working.

In api.php setLocale, getLocale functions working when I return the response, but it doesn't affect the @lang('messages.smth') or {{ __('messages.smth) }}. I think the route can't find the (messages.smth) but in web.php all are working correctly. Thanks

近期文章

  • <select>下拉选项值未保存到wordpress插件设置页面中的数据库
  • 为什么$ mail-> body = $消息的空值?
  • Sweetaleart没有在同一页面上发布ajax请求
  • 无法更新MySQL数据库中的单元格?
  • 未定义的变量:刀片层级5.6中的类别
  • Javascript:将第二个下拉选项附加到URL
  • 在刀片视图中从jquery变量传递路由参数
  • 如何使用“not with”显示表单字段属性?[重复]
  • 微信H5支付不起作用
  • Laravel检查工作是否延伸到某个班级
  • SQLSTATE [42601]:语法错误:7内部连接错误
  • 如何在javascript中检查php变量值
  • 使用PHP将JSON对象中的元素插入数据库
  • .htaccess用于子文件夹中的项目(xampp)
  • symfony 3.4.14 collectionType编辑和删除问题
  • mPDF - 临时文件目录...不可写
  • Wordpress:发布任何帖子时触发一个功能
  • Yii2 - 压缩cookie值或更好的替代品
  • codeigniter-表格与图像和pdf上传
  • 如何正确扩展本地目录站点的类?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华