【问题标题】:joedixon/laravel-translation not working during updatejoedixon/laravel 翻译在更新期间不起作用
【发布时间】:2021-10-18 09:33:25
【问题描述】:

出于测试目的,我安装了新的 Laravel-7 并安装了 joedixon/laravel-translation 包,一切正常。 之后我更改了根目录和其他目录(我必须更改以在另一个正在运行的项目中实现 Translation 像这样的根目录)-

改变事物是-

  1. index.php 移至根目录,例如:myproject/public/index.phpmyproject/ index.php
  2. .htaccess 移至根目录
  3. index.php 中,更改了- 需要 __ DIR __.'/vendor/autoload.php';
    $app = require_once __ DIR __.'/bootstrap/app.php';
  4. 对于翻译,我在 resources/views/vendor/translation/layout.blade.php 中添加了 /public/ 用于 css、js 的路径

现在一切正常,但是当我尝试更新翻译文件时,它会引发错误,显示未找到请求的 url。 其他一切似乎都可以正常工作,希望更新翻译。
如何解决?

附上截图。
enter image description here

【问题讨论】:

    标签: php laravel translation


    【解决方案1】:

    我之前没有使用过这个包,但我注意到你请求的 URL 中有一个双斜杠 // 你试图发布到(在屏幕截图中),这样可能会导致 404,因为两者之间存在差异

    http://localhost/cartpro_language_test//languages/bn

    http://localhost/cartpro_language_test/languages/bn

    确保它在您的路线中可访问检查php artisan route:list

    默认情况下,它可以在/languages 而非/cartpro_language_test/languages 下访问,因此请验证您是否进行了任何其他更改导致网址与原来的网址不同

    我做了完全相同的修改,它对我有用

    【讨论】:

      猜你喜欢
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-18
      • 2013-10-09
      • 2015-06-23
      • 2014-04-20
      相关资源
      最近更新 更多