gpt4 book ai didi

laravel - 方法 Illuminate\Support\Str::replace 不存在

转载 作者:行者123 更新时间:2023-12-04 16:24:36 25 4
gpt4 key购买 nike

我在用:

  • Laravel 版本:8.35.1
  • PHP 版本:7.4.9

  • 在 Tinker 和 Routing 我使用 Str::replace()方法如 docs但得到错误:

    BadMethodCallException with message Method Illuminate\Support\Str::replace does not exist.


    示例 1:
    root@c6dd4af63e3c:/var/www/html# php artisan tinker
    Psy Shell v0.10.7 (PHP 7.4.9 — cli) by Justin Hileman
    >>> Illuminate\Support\Str::replace('8.x', '9.x', 'Laravel 8.x');
    BadMethodCallException with message 'Method Illuminate\Support\Str::replace does not exist.'
    >>>
    示例2:
    Route::get('/test', function () {
    return Illuminate\Support\Str::replace('8.x', '9.x', 'Laravel 8.x');
    });
    为什么会出现此错误以及如何修复?

    最佳答案

    字符串替换方法 Illuminate\Support\Str::replace在 Laravel 版本中引入 v8.41.0 enter image description here
    引用:https://github.com/laravel/framework/releases/tag/v8.41.0

    关于laravel - 方法 Illuminate\Support\Str::replace 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67974632/

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