風(fēng)信網(wǎng)軟件項目開發(fā)版本為Laravel 6.2,現(xiàn)Laravel已發(fā)布7.0的版本,現(xiàn)將原項目進行升級,升級流程如下:
修改composer.json文件
laravel/framework 依賴版本到 ^7.0
unomaduro/collision 依賴版本到 ^4.1
phpunit/phpunit 依賴版本到 ^8.5
laravel/tinker 依賴版本到 ^2.0
以及 facade/ignition 依賴版本到 ^2.0
Symfony 5 相關(guān)更新
修改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!
更新認(rèn)證方式
composer require laravel/ui "^2.0"
Blade模板
Blade::component 方法已重命名為 Blade::aliasComponent
至此Laravel 7.0升級完成!風(fēng)信建站專業(yè)網(wǎng)站開發(fā),Web應(yīng)用開發(fā),微信開發(fā)、小程序開發(fā),網(wǎng)站系統(tǒng)重構(gòu)專業(yè)技術(shù)服務(wù)公司,如有相關(guān)開發(fā)需求歡迎至電:189-8648-0214,專業(yè)的技術(shù)助您解決企業(yè)的難題。