Skip to content

Commit

Permalink
Merge pull request #81 from kg-bot/upgrade/laravel/v9
Browse files Browse the repository at this point in the history
Support for Laravel 9
  • Loading branch information
kg-bot authored Feb 12, 2022
2 parents 58e060a + 8414f0c commit bd3b943
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@ which can later be converted to JSON object and used with libraries like Vue, An

## Installing

Just require this package with composer.
#### Laravel before version 9

```
composer require kg-bot/laravel-localization-to-vue
composer require kg-bot/laravel-localization-to-vue:^1
```

### Laravel 8.0+
Laravel 8.0 require minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.
#### Laravel 9

```
composer require kg-bot/laravel-localization-to-vue:^2
```


### Laravel 8+
Laravel 8 requires minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.

### Laravel 9+
Laravel 9 requires minimum of PHP 8.0.2 make sure you have at least PHP 8.0.2 before running composer.

### Laravel 5.5+

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

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

It can be just one path or multiple paths, for example
```php
paths => [resource_path('lang'), app_path('lang'), app_path('Modules/Blog/lang')]
paths => [lang_path(), app_path('lang'), app_path('Modules/Blog/lang')]
```

You can run your own callback function after export, to do that you must register globally accessible function, for example
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "kg-bot/laravel-localization-to-vue",
"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",
"require": {
"laravel/framework": "5.*|^6|^7|^8",
"php": "^8.0",
"laravel/framework": "5.*|^6|^7|^8|^9",
"ext-json": "*"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/ExportMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Illuminate\Console\Command;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter as Local;

class ExportMessages extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/ExportMessagesToFlat.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Illuminate\Console\Command;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter as Local;

class ExportMessagesToFlat extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/config/laravel-localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
* In you .env file just add:
* LARAVEL_LOCALIZATION_LANG_DIRS=resources/lang,Modules/Blog/Resources/lang
*/
'lang_dirs' => [resource_path('lang')],
'lang_dirs' => [lang_path()],
],
/**
* You can customize the regexp for lang files to be able to exclude certain files.
Expand Down

0 comments on commit bd3b943

Please sign in to comment.