評估升級 laravel 會遇到什麼困難
Opened this issue · 5 comments
FWcloud916 commented
請 @unciax @Chung-Wei-Pan 幫忙確認
Chung-Wei-Pan commented
之前別的專案升到 7 遇到的問題
First, the report, render, shouldReport, and renderForConsole methods of your application's App\Exceptions\Handler class should accept instances of the Throwable interface instead of Exception instances:
use Throwable;
public function report(Throwable $exception);
public function shouldReport(Throwable $exception);
public function render($request, Throwable $exception);
public function renderForConsole($output, Throwable $exception);
Chung-Wei-Pan commented
faker 套件改用 fakerphp/faker
./database/seeds
改為 ./database/seeders
,不改的話測試不會,再將 seeder 內的所有 class 新增 namespace Database\Seeders
,並且將原先 Factory 路徑改成 \Faker\Factory
unciax commented
maatwebsite/excel 原使用版本不支援 Laravel 6/7/8 ,需升級到 3.1 (不然也會因為相依套件版本衝突 update failed)
ref: https://github.com/Maatwebsite/Laravel-Excel
Chung-Wei-Pan commented
我剛剛偷偷升了一下 composer.json
"require": {
"php": "^7.3|^8.0",
"botman/botman": "^2.4",
"botman/driver-telegram": "^1.5",
"botman/studio-addons": "^1.5",
"creativeorange/gravatar": "~1.0",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.4",
"jenssegers/agent": "^2.6",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.5",
"maatwebsite/excel": "^3.1",
"spatie/laravel-permission": "^4.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3",
"facade/ignition": "^2.5"
},
...
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeders",
"database/factories"
]
},
Chung-Wei-Pan commented
Routing 需要修改
routes/api.php
routes/web.php