Upgrade ke laravel 13#1050
Merged
Merged
Conversation
- Upgrade composer deps melalui 3 fase (L10→L11→L12→L13) - Bump 12 package ke major version baru (slug, datatables, CSP, image, dll) - Migrasi Intervention Image v2→v3 (Image::make → read, resize → scale) - Migrasi Spatie CSP v2→v3 (Policy → Preset, addDirective → add, config format) - Tambah helper csp_nonce() (dihilangkan di CSP v3) - Tambah CspExclusion middleware untuk route exclusion - Publikasikan ulang config/image.php, config/jsvalidation.php - Update CustomCSPPolicy → CustomCspPreset implement Preset interface - Update CSP test untuk v3 API - Catat temuan post-upgrade di UPGRADE_LARAVEL_13_PLAN.md
|
🔄 AI PR Review sedang antri di server...
|
Contributor
Author
|
upload file pada slider simplescreenrecorder-2026-06-04_14.26.37.mp4update logo aplikasi simplescreenrecorder-2026-06-04_14.35.08.mp4website presisi simplescreenrecorder-2026-06-04_14.39.07.mp4 |
…upgrade/laravel-13
…upgrade/laravel-13
…upgrade/laravel-13
Contributor
|
sudah oke, pengecekan detailnya akan dilakukan di #1051 |
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Upgrade Laravel 10.48 → 13.13 (PHP 8.3)
Deskripsi
Upgrade framework Laravel dari versi 10.48.29 ke 13.13.0, beserta seluruh dependency pendukung ke versi yang kompatibel. Upgrade ini dilakukan bertahap (L10→L11→L12→L13) untuk memastikan aplikasi tetap up-to-date dengan framework terbaru, mengurangi gap versi, dan memudahkan penerapan patch keamanan serta upgrade di masa depan. PHP requirement dinaikkan dari ^8.1 ke ^8.3 sesuai syarat sistem Laravel 13.
Perubahan yang dilakukan:
laravel/framework^10.48 → ^13.0, PHP ^8.1 → ^8.4. Seluruh dependency mayor di-update ke versi kompatibel (Sanctum 4, Tinker 3, PHPUnit 11, Collision 8, dll).CustomCSPPolicy(extendBasic) digantiCustomCspPreset(implementPreset). MethodaddDirective()→add(). Route exclusion dipindah ke middlewareCspExclusionterpisah. Config filecsp.phpdirestruktur.Image::make()→Image::read(),->resize()→->scale(),->save()pakai named argumentquality:. Service provider & facade import diperbarui. Configconfig/image.phpditerbitkan.env()mengembalikan string, tapi Carbon 3 mewajibkanint|float. Semua numeric config values diconfig/app.phpdanconfig/rate-limiter.phpdiberi(int)cast.csp_nonce()helper didefinisikan secara manual diapp/Helpers/general.php(helper ini dihapus di CSP v3).VisitorObserveruntukLocation::get(), guard@if(isset($article->id))di blade artikel, dan fallbackurl()untuk route dinamis.nonce=csp_nonce(), gantiDOMContentLoaded→jQuery.ready().BaseRepository.php— perbaiki nullable syntax?intuntuk kompatibilitas PHP 8.4.8.1ke8.4.Alasan perubahan:
Dampak perubahan:
✅ Framework up-to-date: Laravel 13.13 dengan dukungan penuh dan patch keamanan terbaru
✅ Dependency modern: Semua package mayor di-update ke versi kompatibel Laravel 13
✅ Security: CSP nonce bekerja dengan benar, inline styles/scripts tidak diblokir
✅ Stability: Carbon 3 strict types terpenuhi — tidak ada error runtime
✅ Zero test regression: 405 test passing (0 failures, 0 errors)
✅ CI/CD: GitHub Actions menggunakan PHP 8.3 sesuai requirement baru
Masalah Terkait (Related Issue)
Langkah untuk mereproduksi (Steps to Reproduce)
Sebelum upgrade (masalah):
composer installdengan PHP 8.1 dan Laravel 10Carbon::rawAddUnit(): Argument #3 must be of type int|float, string givenMissing required parameter for Route: web.artikel.showSetelah upgrade (fix):
composer installdengan PHP 8.4 dan Laravel 13Testing pada fitur lain yang terkait:
Daftar Periksa (Checklist)
Teknis Detail
Penjelasan Teknis
Migration Spatie CSP v2 → v3
CSP v3 mengubah arsitektur secara fundamental:
Spatie\Csp\Policies\Basic. Sekarang class preset harus mengimplementSpatie\Csp\Presetdan menerimaPolicyobject di methodconfigure().addDirective(Directive::STYLE, [...])→add(Directive::STYLE, [...])$policy->addNonce(Directive::SCRIPT)untuk menambahkan nonce secara otomatis.shouldBeApplied()dihapus. Route exclusion ditangani middlewareCspExclusionyang menonaktifkan CSP viaconfig(['csp.enabled' => false]).Keyword::SELF: Wajib ditambahkan secara eksplisit untuk mengizinkan resource dari origin sendiri.Intervention Image v2 → v3
Carbon 3 Strict Types
Carbon 3 memiliki tipe parameter yang lebih ketat untuk semua method manipulasi waktu. Semua nilai integer dari
env()adalah string, sehingga:Konfigurasi yang berubah
composer.jsonconfig/csp.phppolicy→presetsarray, tambahnonce_enabled,report_only_*, dllconfig/app.phpconfig/rate-limiter.phpconfig/image.phpconfig/jsvalidation.phpbootstrap4→bootstrap,ignorediubahDependencies yang ditambahkan
intervention/image-laravel: ^1.2 (adapter Laravel untuk Intervention Image v3)Dependencies yang dihapus
doctrine/dbal: Tidak diperlukan lagi di Laravel 11+Testing
Manual Testing
php artisan optimize:clearberjalan cleanphp artisan config:cacheberjalan cleanAutomated Testing
Breaking Changes
Image::make(),->resize(), atau->save($q, $fmt)harus diubahcsp.phptidak kompatibel dengan versi 2; policy class harus diubah ke presetaddDays(),addMinutes(), dll harus di-cast ke intReferences