Skip to content

Commit bd3b943

Browse files
authored
Merge pull request #81 from kg-bot/upgrade/laravel/v9
Support for Laravel 9
2 parents 58e060a + 8414f0c commit bd3b943

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,24 @@ which can later be converted to JSON object and used with libraries like Vue, An
1515

1616
## Installing
1717

18-
Just require this package with composer.
18+
#### Laravel before version 9
1919

2020
```
21-
composer require kg-bot/laravel-localization-to-vue
21+
composer require kg-bot/laravel-localization-to-vue:^1
2222
```
2323

24-
### Laravel 8.0+
25-
Laravel 8.0 require minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.
24+
#### Laravel 9
25+
26+
```
27+
composer require kg-bot/laravel-localization-to-vue:^2
28+
```
29+
30+
31+
### Laravel 8+
32+
Laravel 8 requires minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.
33+
34+
### Laravel 9+
35+
Laravel 9 requires minimum of PHP 8.0.2 make sure you have at least PHP 8.0.2 before running composer.
2636

2737
### Laravel 5.5+
2838

@@ -46,12 +56,12 @@ You can export config by running
4656
php artisan vendor:publish --provider="KgBot\LaravelLocalization\LaravelLocalizationServiceProvider" --tag=config
4757
```
4858

49-
if you want to parse multiple language directories or some other directory except `resources/lang` you can add multiple
59+
if you want to parse multiple language directories or some other directory except `lang_path()` you can add multiple
5060
paths in config `paths.lang_dirs` inside array.
5161

5262
It can be just one path or multiple paths, for example
5363
```php
54-
paths => [resource_path('lang'), app_path('lang'), app_path('Modules/Blog/lang')]
64+
paths => [lang_path(), app_path('lang'), app_path('Modules/Blog/lang')]
5565
```
5666

5767
You can run your own callback function after export, to do that you must register globally accessible function, for example

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "kg-bot/laravel-localization-to-vue",
33
"description": "Laravel package used to collect all localization files from resources/lang (and custom) directories and sub-directories and make them available as JSON file",
44
"require": {
5-
"laravel/framework": "5.*|^6|^7|^8",
5+
"php": "^8.0",
6+
"laravel/framework": "5.*|^6|^7|^8|^9",
67
"ext-json": "*"
78
},
89
"keywords": [

src/Console/Commands/ExportMessages.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Illuminate\Console\Command;
66
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
7-
use League\Flysystem\Adapter\Local;
87
use League\Flysystem\Filesystem;
8+
use League\Flysystem\Local\LocalFilesystemAdapter as Local;
99

1010
class ExportMessages extends Command
1111
{

src/Console/Commands/ExportMessagesToFlat.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Illuminate\Console\Command;
66
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
7-
use League\Flysystem\Adapter\Local;
87
use League\Flysystem\Filesystem;
8+
use League\Flysystem\Local\LocalFilesystemAdapter as Local;
99

1010
class ExportMessagesToFlat extends Command
1111
{

src/config/laravel-localization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
* In you .env file just add:
8787
* LARAVEL_LOCALIZATION_LANG_DIRS=resources/lang,Modules/Blog/Resources/lang
8888
*/
89-
'lang_dirs' => [resource_path('lang')],
89+
'lang_dirs' => [lang_path()],
9090
],
9191
/**
9292
* You can customize the regexp for lang files to be able to exclude certain files.

0 commit comments

Comments
 (0)