Code/PHP

라라벨 업그레이드 매뉴얼 정리 ( 6 -> 7 -> 8 -> 9)

codens 2022. 2. 16. 04:25

    - laravel upgade manual



//-----------------------------------------------------------------------------
6.x -> 7.x
https://laravel.kr/docs/7.x/upgrade

    - App\Exceptions\Handler.php 수정



    - config\session.php 파일  수정
'secure' => env('SESSION_SECURE_COOKIE', null),


    - composer.json에 추가
"laravel/ui": "^2.0"
"fruitcake/laravel-cors": "^2.0",


    - 숫자 직렬화 변경, 날짜 문자열 형식 포맷 변경됨
2019-12-02 20:01:00 => 2019-12-02T20:01:00.283041Z



//-----------------------------------------------------------------------------
7.x -> 8.x
https://laravel.kr/docs/8.x/upgrade

    - composer.json 수정
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
-dev
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"


    - 기본 Pagination이 Tailwind 로 바뀜, 기존 Bootstrap을 사용하려면
app\Providers\AppServiceProvider.php, boot() 함수에 다음을 추가

\Illuminate\Pagination\Paginator::useBootstrap();


//-----------------------------------------------------------------------------
8.x -> 9.x
https://laravel.com/docs/9.x/upgrade
    - composer.json 수정
"laravel/framework": "^9.0",
        - dev
"nunomaduro/collision": "^6.1",
"spatie/laravel-ignition": "^1.0",


    - 환경변수 이름 변경 권장 사항
FILESYSTEM_DRIVER   =>  FILESYSTEM_DISK


    - Mailer 변경
https://laravel.com/docs/9.x/upgrade#symfony-mailer
- Mailgun 사용시 추가 패키지 필요
"symfony/mailgun-mailer": "^.6.0",
"symfony/http-client": "^.6.0",


    - language 폴더 설정 이동 
        - 이동 시키지 않아도 이전 폴더 자동 인식 , app()->langPath() 로 확인
/resourses/lang   => /lang


    - TrustProxies 변경

"fideloper/proxy" 패키지 삭제

use Fideloper\Proxy\TrustProxies as Middleware 을 다음으로 변경
use Illuminate\Http\Middleware\TrustProxies as Middleware

    - app/Http/Middleware/TrustProxies.php 파일 수정
// Before...
protected $headers = Request::HEADER_X_FORWARDED_ALL;
 
// After...
protected $headers =
    Request::HEADER_X_FORWARDED_FOR |
    Request::HEADER_X_FORWARDED_HOST |
    Request::HEADER_X_FORWARDED_PORT |
    Request::HEADER_X_FORWARDED_PROTO |
    Request::HEADER_X_FORWARDED_AWS_ELB;

 

//-----------------------------------------------------------------------------

참고

라라벨 버전 v6 -> v9 로 업그레이드 방법

https://codens.info/2340

 

반응형