From d4358ad666dd63df9938e45d54f052450c4d44d3 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Mon, 9 Sep 2019 21:02:44 +0100 Subject: [PATCH] Support for Laravel 6 --- composer.json | 4 ++-- src/Http/Controllers/LanguageTranslationController.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 95b0170..34058e4 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "license": "MIT", "require": { "php": ">=7.1.0", - "joedixon/laravel-translation": "^0.3.0" + "joedixon/laravel-translation": "^1.0.0" }, "autoload": { "psr-4": { @@ -27,4 +27,4 @@ }, "minimum-stability": "dev", "prefer-stable": true -} +} \ No newline at end of file diff --git a/src/Http/Controllers/LanguageTranslationController.php b/src/Http/Controllers/LanguageTranslationController.php index e76ff8c..0c3a6a8 100644 --- a/src/Http/Controllers/LanguageTranslationController.php +++ b/src/Http/Controllers/LanguageTranslationController.php @@ -2,6 +2,7 @@ namespace Joedixon\NovaTranslation\Http\Controllers; +use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Pagination\Paginator; @@ -51,7 +52,7 @@ public function index(Request $request, $language) public function update(Request $request, $language) { - if (! str_contains($request->get('group'), 'single')) { + if (! Str::contains($request->get('group'), 'single')) { $this->translation->addGroupTranslation($language, $request->get('group'), $request->get('key'), $request->get('value') ?: ''); } else { $this->translation->addSingleTranslation($language, $request->get('group'), $request->get('key'), $request->get('value') ?: ''); @@ -84,7 +85,7 @@ private function formatTranslations($translations, $language) continue; } $formattedTranslations[] = [ - 'id' => str_random(20), + 'id' => Str::random(20), 'type' => $type, 'group' => $group, 'key' => $key,