From df1a557ea25518e384697232a38d81aa502af05e Mon Sep 17 00:00:00 2001 From: Sudip Palash Date: Sat, 23 Jul 2022 21:34:40 +0600 Subject: [PATCH] add line break and tab before line --- README.md | 8 ++++---- src/Http/Controllers/LanguageController.php | 2 +- src/Traits/LangUtility.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0a7ea04..0b7d711 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Via Composer ```bash -$ composer require sudippalash/lang-maker +composer require sudippalash/lang-maker ``` #### Publish config file @@ -59,8 +59,8 @@ In `config/lang-maker.php` config file you should set `lang-maker` global path. | If language route use any middleware then provide it or leave empty array. Example: ['auth '] */ - 'route_name' => 'admin.language', - 'route_prefix' => 'admin/language', + 'route_name' => 'user.language', + 'route_prefix' => 'user/language', 'middleware' => [], /* @@ -71,7 +71,7 @@ In `config/lang-maker.php` config file you should set `lang-maker` global path. | specify the file names (without extension) in array which you want to ignore to modify or leave it blank array */ - 'ignore_lang_file' => ['validation'], + 'ignore_lang_file' => [], //['validation', 'pagination'] /* |-------------------------------------------------------------------------- diff --git a/src/Http/Controllers/LanguageController.php b/src/Http/Controllers/LanguageController.php index abf9d92..28bc0e6 100644 --- a/src/Http/Controllers/LanguageController.php +++ b/src/Http/Controllers/LanguageController.php @@ -101,7 +101,7 @@ public function update(Request $request, $currantLang) if (!empty($request->message)) { foreach($request->message as $fileName => $fileData) { - $content = "buildArray($fileData); $content .= "];"; file_put_contents($langFolder . "/" . $fileName . '.php', $content); diff --git a/src/Traits/LangUtility.php b/src/Traits/LangUtility.php index 9012cb1..b44987e 100644 --- a/src/Traits/LangUtility.php +++ b/src/Traits/LangUtility.php @@ -29,9 +29,9 @@ public function buildArray($fileData) $content = ""; foreach ($fileData as $lable => $data) { if(is_array($data)) { - $content .= "'$lable'=>[" . $this->buildArray($data) . "],"; + $content .= "\t'$lable' => [" . $this->buildArray($data) . "],\n"; } else { - $content .= "'$lable'=>'" . addslashes($data) . "',"; + $content .= "\t'$lable' => '" . addslashes($data) . "',\n"; } }