diff --git a/.env.example b/.env.example index 7ea35d1..b5ed705 100755 --- a/.env.example +++ b/.env.example @@ -66,3 +66,4 @@ PAY_GATWAY=zarinpal THUMBNAIL_SIZE=600x600 XLANG=false XLANG_MAIN=en +XLANG_API_URL="http://5.255.98.77:3001" diff --git a/app/Http/Controllers/Admin/XlangController.php b/app/Http/Controllers/Admin/XlangController.php index c7f38d7..61d2c7d 100644 --- a/app/Http/Controllers/Admin/XlangController.php +++ b/app/Http/Controllers/Admin/XlangController.php @@ -194,7 +194,7 @@ class XlangController extends Controller define("TRANSLATE_FILE", PREFIX_PATH . 'resources/lang/' . $tag . '.json'); $file = file_get_contents(TRANSLATE_FILE); - $url = 'http://5.255.98.77:3001/json?form=en&to=' . $tag; + $url = config('app.xlang_api_url').'/json?form=en&to=' . $tag; $client = new Client([ 'headers' => ['Content-Type' => 'application/json'] @@ -282,7 +282,7 @@ class XlangController extends Controller $langs = Xlang::where('is_default', 0)->get(); $model = ($model)::where('id', $id)->firstOrFail(); // $model = Product::whereId('id',$id)->first(); - $url = 'http://5.255.98.77:3001/text?form=' . config('app.xlang_main') . '&to=' . $tag; + $url = config('app.xlang_api_url').'/text?form=' . config('app.xlang_main') . '&to=' . $tag; $client = new Client([ 'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'] diff --git a/config/app.php b/config/app.php index 5b06914..a810dd4 100755 --- a/config/app.php +++ b/config/app.php @@ -95,6 +95,7 @@ return [ 'locale' => 'fa', 'xlang' => env('XLANG',false), 'xlang_main' => env('XLANG_MAIN','en'), + 'xlang_api_url' => env('XLANG_API_URL','en'), /* |--------------------------------------------------------------------------