Skip to content

Commit 0a64867

Browse files
Merge pull request #42 from cuneytsenturk/2.0-dev
Upgrade php and laravel versions..
2 parents 83285fb + 7d765d5 commit 0a64867

23 files changed

+1268
-76
lines changed

.github/workflows/tests.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# Laravel 5.8 - PHP 7.2, 7.3, 7.4
18+
- laravel: 5.8.*
19+
php: 7.2
20+
testbench: 3.8.*
21+
- laravel: 5.8.*
22+
php: 7.3
23+
testbench: 3.8.*
24+
- laravel: 5.8.*
25+
php: 7.4
26+
testbench: 3.8.*
27+
28+
# Laravel 6 - PHP 7.2, 7.3, 7.4, 8.0
29+
- laravel: 6.*
30+
php: 7.2
31+
testbench: 4.*
32+
- laravel: 6.*
33+
php: 7.3
34+
testbench: 4.*
35+
- laravel: 6.*
36+
php: 7.4
37+
testbench: 4.*
38+
- laravel: 6.*
39+
php: 8.0
40+
testbench: 4.*
41+
42+
# Laravel 7 - PHP 7.2, 7.3, 7.4, 8.0
43+
- laravel: 7.*
44+
php: 7.2
45+
testbench: 5.*
46+
- laravel: 7.*
47+
php: 7.3
48+
testbench: 5.*
49+
- laravel: 7.*
50+
php: 7.4
51+
testbench: 5.*
52+
- laravel: 7.*
53+
php: 8.0
54+
testbench: 5.*
55+
56+
# Laravel 8 - PHP 7.3, 7.4, 8.0, 8.1
57+
- laravel: 8.*
58+
php: 7.3
59+
testbench: 6.*
60+
- laravel: 8.*
61+
php: 7.4
62+
testbench: 6.*
63+
- laravel: 8.*
64+
php: 8.0
65+
testbench: 6.*
66+
- laravel: 8.*
67+
php: 8.1
68+
testbench: 6.*
69+
70+
# Laravel 9 - PHP 8.0, 8.1, 8.2
71+
- laravel: 9.*
72+
php: 8.0
73+
testbench: 7.*
74+
- laravel: 9.*
75+
php: 8.1
76+
testbench: 7.*
77+
- laravel: 9.*
78+
php: 8.2
79+
testbench: 7.*
80+
81+
# Laravel 10 - PHP 8.1, 8.2, 8.3
82+
- laravel: 10.*
83+
php: 8.1
84+
testbench: 8.*
85+
- laravel: 10.*
86+
php: 8.2
87+
testbench: 8.*
88+
- laravel: 10.*
89+
php: 8.3
90+
testbench: 8.*
91+
92+
# Laravel 11 - PHP 8.2, 8.3, 8.4
93+
- laravel: 11.*
94+
php: 8.2
95+
testbench: 9.*
96+
- laravel: 11.*
97+
php: 8.3
98+
testbench: 9.*
99+
- laravel: 11.*
100+
php: 8.4
101+
testbench: 9.*
102+
103+
# Laravel 12 - PHP 8.2, 8.3, 8.4
104+
- laravel: 12.*
105+
php: 8.2
106+
testbench: 10.*
107+
- laravel: 12.*
108+
php: 8.3
109+
testbench: 10.*
110+
- laravel: 12.*
111+
php: 8.4
112+
testbench: 10.*
113+
114+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
115+
116+
steps:
117+
- name: Checkout code
118+
uses: actions/checkout@v4
119+
120+
- name: Setup PHP
121+
uses: shivammathur/setup-php@v2
122+
with:
123+
php-version: ${{ matrix.php }}
124+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
125+
coverage: none
126+
127+
- name: Setup problem matchers
128+
run: |
129+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
130+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
131+
132+
- name: Install dependencies
133+
run: |
134+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
135+
composer update --prefer-stable --prefer-dist --no-interaction
136+
137+
- name: List installed dependencies
138+
run: composer show -D
139+
140+
- name: Execute tests
141+
run: vendor/bin/phpunit --no-coverage

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
# Language switcher package for Laravel
22

33
![Downloads](https://img.shields.io/packagist/dt/akaunting/laravel-language)
4+
![Tests](https://github.com/akaunting/laravel-language/workflows/Tests/badge.svg)
45
[![StyleCI](https://github.styleci.io/repos/102290249/shield?style=flat&branch=master)](https://styleci.io/repos/102290249)
56
[![Quality](https://img.shields.io/scrutinizer/quality/g/akaunting/laravel-language?label=quality)](https://scrutinizer-ci.com/g/akaunting/laravel-language)
67
[![License](https://img.shields.io/github/license/akaunting/laravel-language)](LICENSE.md)
78

89
This package allows switching locale easily on Laravel projects. It's so simple to use, once it's installed, your App locale will change only by passing routes into SetLanguage middleware.
910

11+
## Version Compatibility
12+
13+
| Laravel | PHP | Package |
14+
|---------|-----------|---------|
15+
| 5.8 | 7.2 - 7.4 | ^2.0 |
16+
| 6.x | 7.2 - 8.0 | ^2.0 |
17+
| 7.x | 7.2 - 8.0 | ^2.0 |
18+
| 8.x | 7.3 - 8.1 | ^2.0 |
19+
| 9.x | 8.0 - 8.2 | ^2.0 |
20+
| 10.x | 8.1 - 8.3 | ^2.0 |
21+
| 11.x | 8.2 - 8.4 | ^2.0 |
22+
| 12.x | 8.2 - 8.5 | ^2.0 |
23+
1024
**Top features:**
1125

1226
- Change automatically app locale depending on user browser configuration
@@ -28,28 +42,38 @@ Run the following command:
2842
composer require akaunting/laravel-language
2943
```
3044

31-
### 2. Register (for Laravel < 5.5)
45+
### 2. Register (Optional - Laravel 5.5+ Auto-Discovery)
3246

33-
Register the service provider in ``config/app.php``
47+
> **Note**: Laravel 5.5+ automatically discovers the package. Manual registration is only needed for older versions.
48+
49+
For Laravel < 5.5, register the service provider in `config/app.php`:
3450

3551
```php
3652
Akaunting\Language\Provider::class,
3753
```
3854

39-
Add alias if you want to use the facade.
55+
Add alias if you want to use the facade:
4056

4157
```php
42-
'Language' => Akaunting\Language\Facade::class,
58+
'Language' => Akaunting\Language\Facade::class,
4359
```
4460

4561
### 3. Publish
4662

4763
Publish config, migration and blade files.
4864

49-
```
65+
```bash
5066
php artisan vendor:publish --tag=language
5167
```
5268

69+
**Optional:** Publish flag images for customization (only if you want to replace flag images):
70+
71+
```bash
72+
php artisan vendor:publish --tag=language-flags
73+
```
74+
75+
This will copy flag images to `public/vendor/language/flags/` where you can replace them with your custom flags. The package will automatically use your custom flags if they exist, otherwise it will use the default package flags.
76+
5377
### 4. Migrate
5478

5579

@@ -181,6 +205,7 @@ If you discover any security related issues, please email security@akaunting.com
181205

182206
## Credits
183207

208+
- [Cüneyt Şentürk](https://github.com/cuneytsenturk)
184209
- [Denis Duliçi](https://github.com/denisdulici)
185210
- [All Contributors](../../contributors)
186211

composer.json

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,22 @@
1313
"email": "info@akaunting.com",
1414
"homepage": "https://akaunting.com",
1515
"role": "Developer"
16+
},
17+
{
18+
"name": "Cüneyt Şentürk",
19+
"email": "info@akaunting.com",
20+
"homepage": "https://akaunting.com",
21+
"role": "Developer"
1622
}
1723
],
1824
"require": {
19-
"php": ">=5.6.4",
20-
"laravel/framework": ">=5.4.0",
21-
"jenssegers/agent": "2.6.*"
25+
"php": "^7.2|^8.0",
26+
"laravel/framework": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
27+
"jenssegers/agent": "^2.6"
28+
},
29+
"require-dev": {
30+
"orchestra/testbench": "^3.8|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
31+
"phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0|^11.0"
2232
},
2333
"autoload": {
2434
"psr-4": {
@@ -28,6 +38,22 @@
2838
"src/helpers.php"
2939
]
3040
},
41+
"autoload-dev": {
42+
"psr-4": {
43+
"Akaunting\\Language\\Tests\\": "tests"
44+
}
45+
},
46+
"scripts": {
47+
"test": "vendor/bin/phpunit --no-coverage",
48+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
49+
},
50+
"config": {
51+
"sort-packages": true,
52+
"preferred-install": "dist",
53+
"optimize-autoloader": true
54+
},
55+
"minimum-stability": "dev",
56+
"prefer-stable": true,
3157
"extra": {
3258
"laravel": {
3359
"providers": [

phpunit.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
backupGlobals="false"
7+
processIsolation="false"
8+
stopOnFailure="false">
9+
<testsuites>
10+
<testsuite name="Unit">
11+
<directory suffix="Test.php">./tests/Unit</directory>
12+
</testsuite>
13+
<testsuite name="Feature">
14+
<directory suffix="Test.php">./tests/Feature</directory>
15+
</testsuite>
16+
</testsuites>
17+
<coverage>
18+
<include>
19+
<directory suffix=".php">./src</directory>
20+
</include>
21+
<report>
22+
<html outputDirectory="build/coverage"/>
23+
<text outputFile="build/coverage.txt"/>
24+
<clover outputFile="build/logs/clover.xml"/>
25+
</report>
26+
</coverage>
27+
<php>
28+
<env name="APP_ENV" value="testing"/>
29+
<env name="APP_KEY" value="base64:ZHVtbXlrZXlmb3J0ZXN0aW5ncHVycG9zZXNvbmx5"/>
30+
<env name="CACHE_DRIVER" value="array"/>
31+
<env name="SESSION_DRIVER" value="array"/>
32+
<env name="QUEUE_DRIVER" value="sync"/>
33+
</php>
34+
</phpunit>

0 commit comments

Comments
 (0)