Skip to content

Commit 9bb8e85

Browse files
cams5792rmariuzzo
authored andcommitted
Add support for Laravel 6 (#134)
* Support laravel 6 * Support Laravel 6 use Str Facade * add dotenv * travis.yml mycrypt php 7.3
1 parent e9f582a commit 9bb8e85

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before_script:
2121
# PHP version is 5.5 then we should require minimum supported illuminate
2222
# dependencies.
2323
- if [[ `php -v` =~ "PHP 5.5" ]]; then composer require "illuminate/config:4.2.*" "illuminate/console:4.2.*" "illuminate/filesystem:4.2.*"; fi
24-
- if [[ `php -v` =~ "PHP 7.2" || `php -v` =~ "PHP 7.3" ]]; then yes | pecl install mcrypt-1.0.1; fi
24+
- if [[ `php -v` =~ "PHP 7.2" || `php -v` =~ "PHP 7.3" ]]; then yes | pecl install mcrypt-1.0.2; fi
2525
- composer install --prefer-dist --no-interaction
2626
# Installing `Laravel-JS-Localization` package dependencies for each
2727
# supported Laravel versions (see composer.json, under scripts section).

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"illuminate/config": ">=4.2",
3838
"illuminate/console": ">=4.2",
3939
"illuminate/filesystem": ">=4.2",
40-
"tedivm/jshrink": "~1.0"
40+
"tedivm/jshrink": "~1.0",
41+
"vlucas/phpdotenv": "^3.3"
4142
},
4243
"require-dev": {
4344
"phpunit/phpunit": "4.8.*"

src/Mariuzzo/LaravelJsLocalization/Generators/LangJsGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Mariuzzo\LaravelJsLocalization\Generators;
44

55
use Illuminate\Filesystem\Filesystem as File;
6+
use Illuminate\Support\Str;
67
use JShrink\Minifier;
78

89
/**
@@ -137,7 +138,7 @@ protected function getMessages()
137138
$key = str_replace('\\', '.', $key);
138139
$key = str_replace('/', '.', $key);
139140

140-
if (starts_with($key, 'vendor')) {
141+
if (Str::startsWith($key, 'vendor')) {
141142
$key = $this->getVendorKey($key);
142143
}
143144

src/Mariuzzo/LaravelJsLocalization/LaravelJsLocalizationServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function register()
7272

7373
if ($laravelMajorVersion === 4) {
7474
$langs = $app['path.base'].'/app/lang';
75-
} elseif ($laravelMajorVersion === 5) {
75+
} elseif ($laravelMajorVersion === 5 || $laravelMajorVersion === 6) {
7676
$langs = $app['path.base'].'/resources/lang';
7777
}
7878
$messages = $app['config']->get('localization-js.messages');

0 commit comments

Comments
 (0)