gpt4 book ai didi

php - Laravel Telescope 无法进行全新安装(路径错误)

转载 作者:行者123 更新时间:2023-12-05 00:28:07 28 4
gpt4 key购买 nike

我正在使用 XAMPP,我安装了一个全新的 Laravel 5.8 和 Composer 创建项目 --prefer-dist laravel/laravel larascopy 在 C:\xampp\htdocs\larascopy

我可以通过以下方式访问它:
http://localhost/larascopy/public/

然后使用指南中的这些命令安装 Telescope:

composer require laravel/telescope
php artisan telescope:install
php artisan migrate

然后我可以像这样打开望远镜
http://localhost/larascopy/public/telescope

但是所有的链接都是错误的!他们指的是:
http://localhost/telescope/ ...

所以我在控制台中收到所有这些错误..
POST http://localhost/telescope/telescope-api/commands?tag=&before=&take=50&family_hash= 404 (Not Found)
POST http://localhost/telescope/telescope-api/commands?tag=&before=&take=50&family_hash= 404 (Not Found)
POST http://localhost/telescope/telescope-api/schedule?tag=&before=&take=50&family_hash= 404 (Not Found)
app.js?id=8776cf12ba6d7c72f145:1 Uncaught (in promise) Error: Request failed with status code 404

有没有办法告诉望远镜正确的路径?

最佳答案

我终于找到了解决方案(对于可能遇到此问题的其他任何人)。

  • 打开:\vendor\laravel\telescope\resources\views\layout.blade.php
  • 更改这些行
  • <!-- Global Telescope Object -->
    <script>
    window.Telescope = @json($telescopeScriptVariables);
    </script>

    对此
    <!-- Global Telescope Object -->
    <script>
    window.Telescope = @json($telescopeScriptVariables);
    window.Telescope.path = 'your_project_folder/public/telescope';
    </script>

    关于php - Laravel Telescope 无法进行全新安装(路径错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56129344/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com