项目从Laravel 6升级到Laravel 7后面临的问题由于space/laravel-cors的一些其他错误,我实际上无法将laravel/framework包从6升级到7,但是我删除了space/laravel-cors并升级了laravel/framework,升级后它不会再次安装。下面是完整的错误:
**Problem 1
- spatie/laravel-cors[1.2.0, ..., 1.2.2] require illuminate/support 5.5.*|5.6.* -> found illuminate/support[v5.5.0, ..., v5.6.39] but it conflicts with another require.
- spatie/laravel-cors[1.2.3, ..., 1.3.1] require laravel/framework 5.5.*|5.6.*|5.7.* -> found laravel/framework[v5.5.0, ..., v5.7.29] but it conflicts with your root composer.json require (^7.0).
- spatie/laravel-cors 1.3.2 requires illuminate/support 5.5.*|5.6.*|5.7.* -> found illuminate/support[v5.5.0, ..., v5.7.28] but it conflicts with another require.
- spatie/laravel-cors[1.3.3, ..., 1.5.2] require illuminate/support 5.5.*|5.6.*|5.7.*|5.8.* -> found illuminate/support[v5.5.0, ..., v5.8.36] but it conflicts with another require.
- spatie/laravel-cors 1.6.0 requires illuminate/support 5.5.*|5.6.*|5.7.*|5.8.*|^6.0 -> found illuminate/support[v5.5.0, ..., v5.8.36, v6.0.0, ..., v6.20.17] but it conflicts with another require.
- Root composer.json requires spatie/laravel-cors ^1.2 -> satisfiable by spatie/laravel-cors[1.2.0, ..., 1.6.0].**
在Spatie/Laravel-cors的github页面上,你可以找到这个消息:
我们已经放弃了这个包,因为Laravel 7引入了对CORS的本地支持。只有当你使用Laravel 6或以下版本时才使用这个包。你为什么还需要这个包?