风信网软件项目开发版本为Laravel 6.2,现Laravel已发布7.0的版本,现将原项目进行升级,升级流程如下:
修改composer.json文件
laravel/framework 依赖版本到 ^7.0
unomaduro/collision 依赖版本到 ^4.1
phpunit/phpunit 依赖版本到 ^8.5
laravel/tinker 依赖版本到 ^2.0
以及 facade/ignition 依赖版本到 ^2.0
Symfony 5 相关更新
修改App\Exceptions\Handler中的 report 和 render 方法,并引入Throwable 接口
use Throwable;
public function report(Throwable $exception)
{
parent::report($exception);
}
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
修改session配置文件
config/session.php
'secure' => env('SESSION_SECURE_COOKIE', null),
'same_site' => 'lax',
运行composer命令
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: [32mfacade/ignition[39m
Discovered Package: [32mfideloper/proxy[39m
Discovered Package: [32mintervention/image[39m
Discovered Package: [32mkalnoy/nestedset[39m
Discovered Package: [32mlaravel/tinker[39m
Discovered Package: [32mmews/captcha[39m
Discovered Package: [32mnesbot/carbon[39m
Discovered Package: [32mnunomaduro/collision[39m
Discovered Package: [32mrenatomarinho/laravel-page-speed[39m
[32mPackage manifest generated successfully.[39m
44 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
更新认证方式
composer require laravel/ui "^2.0"
Blade模板
Blade::component 方法已重命名为 Blade::aliasComponent
至此Laravel 7.0升级完成!风信建站专业网站开发,Web应用开发,微信开发、小程序开发,网站系统重构专业技术服务公司,如有相关开发需求欢迎至电:189-8648-0214,专业的技术助您解决企业的难题。