问题描述
我已经创建了我的laravel项目,如下所示:
I've created my laravel project as follows:
laravel new my_app
这将使用laravel版本8创建我的项目.我想使用Laravel 7,所以我修改了composer.json:
This creates my project using laravel version 8. As I want to use Laravel 7, I modified composer.json:
"laravel/framework": "^7.0",
之后,我运行:
composer update
以描述的错误结束(找不到类Illuminate \ Support \ Facades \ RateLimiter)
which ends with the error described (Class Illuminate\Support\Facades\RateLimiter not found )
实际上,该类在Support Facade中不存在.降级程序是否应该纠正这个问题?
In fact, that class doesn't exist in Support facade. Shouldn't downgrade process correct this?
推荐答案
不,这来自您应用程序中的代码;特别是您的 App \ Providers \ RouteServiceProvider
. vendor
中没有的所有内容都被视为您的应用程序,任何升级或降级都不会影响到它. laravel/laravel
软件包仅为您设置应用程序框架.您可以使用 composer create-project --prefer-dist laravel/laravel:^ 7.0 yourproject
专门安装Laravel 7;您可以在Laravel 7的安装指南中找到说明.
No, this is from code in your application; specifically your App\Providers\RouteServiceProvider
. Everything that isn't in vendor
is considered your application and is not touched by any upgrade or downgrade. The laravel/laravel
package only sets up your application skeleton for you. You can install Laravel 7 specifically with composer create-project --prefer-dist laravel/laravel:^7.0 yourproject
; you can find the instructions in the install guide for Laravel 7.
否则,您可能需要将服务提供程序从 laravel/laravel
版本7复制到您的应用程序中,因此您不会使用Laravel 8中的提供程序,因为某些事情已经改变并且引入了一些新功能.而且还会有其他变化.
Otherwise you will need to potentially copy the Service Providers from laravel/laravel
version 7 into your application so you are not using providers from Laravel 8 as some things have changed and some new features were introduced. And there would be other changes as well.
Laravel 7.x文档-安装-通过Composer创建项目 composer create-project
这篇关于找不到类别Illuminate \ Support \ Facades \ RateLimiter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!