Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: codezero-be/laravel-localized-routes
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.4
Choose a base ref
...
head repository: codezero-be/laravel-localized-routes
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,090 additions and 2,423 deletions.
  1. +1 −1 .editorconfig
  2. +1 −0 .gitattributes
  3. +2 −0 .github/FUNDING.yml
  4. +3 −0 .github/SECURITY.md
  5. +53 −0 .github/workflows/run-tests.yml
  6. +1 −0 .gitignore
  7. +0 −35 .scrutinizer.yml
  8. +0 −44 .travis.yml
  9. +0 −87 CHANGELOG.md
  10. +508 −320 README.md
  11. +140 −0 UPGRADE.md
  12. +19 −11 composer.json
  13. +98 −40 config/localized-routes.php
  14. +14 −11 phpunit.xml.dist
  15. +95 −0 src/Controllers/FallbackController.php
  16. +23 −0 src/Facades/LocaleConfig.php
  17. +58 −0 src/Illuminate/Routing/Redirector.php
  18. +175 −0 src/Illuminate/Routing/UrlGenerator.php
  19. +275 −0 src/LocaleConfig.php
  20. +0 −79 src/LocaleHandler.php
  21. +118 −0 src/LocalizedRoutesRegistrar.php
  22. +83 −42 src/LocalizedRoutesServiceProvider.php
  23. +141 −196 src/LocalizedUrlGenerator.php
  24. +0 −22 src/Macros/IsLocalizedMacro.php
  25. +0 −77 src/Macros/LocalizedRoutesMacro.php
  26. +22 −0 src/Macros/Route/HasLocalizedMacro.php
  27. +22 −0 src/Macros/Route/IsFallbackMacro.php
  28. +22 −0 src/Macros/Route/IsLocalizedMacro.php
  29. +22 −0 src/Macros/Route/LocalizedMacro.php
  30. +3 −3 src/Macros/{ → Route}/LocalizedUrlMacro.php
  31. +0 −40 src/Macros/UriTranslationMacro.php
  32. +18 −0 src/Middleware/Detectors/AppDetector.php
  33. +20 −0 src/Middleware/Detectors/BrowserDetector.php
  34. +21 −0 src/Middleware/Detectors/CookieDetector.php
  35. +13 −0 src/Middleware/Detectors/Detector.php
  36. +18 −0 src/Middleware/Detectors/OmittedLocaleDetector.php
  37. +38 −0 src/Middleware/Detectors/RouteActionDetector.php
  38. +21 −0 src/Middleware/Detectors/SessionDetector.php
  39. +50 −0 src/Middleware/Detectors/UrlDetector.php
  40. +27 −0 src/Middleware/Detectors/UserDetector.php
  41. +136 −0 src/Middleware/LocaleHandler.php
  42. +17 −50 src/Middleware/SetLocale.php
  43. +20 −0 src/Middleware/Stores/AppStore.php
  44. +24 −0 src/Middleware/Stores/CookieStore.php
  45. +23 −0 src/Middleware/Stores/SessionStore.php
  46. +15 −0 src/Middleware/Stores/Store.php
  47. +103 −0 src/RouteHelper.php
  48. +0 −172 src/UrlBuilder.php
  49. +0 −158 src/UrlGenerator.php
  50. +2 −2 src/helpers.php
  51. +224 −0 tests/Feature/Macros/Route/IsLocalizedMacroTest.php
  52. +247 −0 tests/Feature/Macros/Route/LocalizedMacroTest.php
  53. +498 −169 tests/{Unit/Macros → Feature/Macros/Route}/LocalizedUrlMacroTest.php
  54. +323 −0 tests/Feature/Middleware/SetLocaleTest.php
  55. +105 −0 tests/Feature/RedirectToLocalizedTest.php
  56. +118 −0 tests/Feature/RouteModelBindingTest.php
  57. +11 −0 tests/Stubs/Controller.php
  58. +7 −20 tests/Stubs/Kernel.php
  59. +12 −9 tests/Stubs/{Model.php → Models/ModelOneWithRouteBinding.php}
  60. +62 −0 tests/Stubs/Models/ModelTwoWithRouteBinding.php
  61. +6 −5 tests/Stubs/{ModelWithCustomRouteParameters.php → Models/ModelWithMultipleRouteParameters.php}
  62. +81 −26 tests/TestCase.php
  63. +105 −0 tests/Unit/Illuminate/Routing/RedirectorTest.php
  64. +435 −0 tests/Unit/Illuminate/Routing/UrlGeneratorTest.php
  65. +246 −0 tests/Unit/LocaleConfigTest.php
  66. +0 −233 tests/Unit/Macros/LocalizedRoutesMacroTest.php
  67. +0 −81 tests/Unit/Macros/UriTranslationMacroTest.php
  68. +145 −0 tests/Unit/Middleware/LocaleHandlerTest.php
  69. +0 −246 tests/Unit/Middleware/SetLocaleTest.php
  70. +0 −244 tests/Unit/UrlGeneratorTest.php
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{package.json,*.scss,*.css}]
[*.yml]
indent_size = 2

[*.md]
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
# Ignore all test and documentation with "export-ignore".
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ko_fi: ivanvermeyen
custom: https://paypal.me/ivanvermeyen
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

If you discover any security related issues, please email ivan@codezero.be instead of using the issue tracker.
53 changes: 53 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 10.* , 11.*]
dependency-version: [ prefer-stable ]
exclude:
- laravel: 11.*
php: 8.1
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: xdebug

- name: Install dependencies
run: composer update --with="illuminate/support:${{ matrix.laravel }}" --with="orchestra/testbench:${{ matrix.testbench }}" --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- if: github.event_name == 'push'
name: Run Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
/phpunit.xml
composer.lock
/.phpunit.cache
/.phpunit.result.cache
35 changes: 0 additions & 35 deletions .scrutinizer.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

87 changes: 0 additions & 87 deletions CHANGELOG.md

This file was deleted.

Loading