| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | protected $namespace = 'Modules\Translation\Http\Controllers'; | 
| 12 | 12 | |
| 13 | 13 | /** | 
| 14 | - * @return string | |
| 14 | + * @return boolean | |
| 15 | 15 | */ | 
| 16 | 16 | protected function getFrontendRoute() | 
| 17 | 17 |      { | 
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | */ | 
| 12 | 12 | public function up() | 
| 13 | 13 |      { | 
| 14 | -        Schema::create('translation__translations', function (Blueprint $table) { | |
| 14 | +        Schema::create('translation__translations', function(Blueprint $table) { | |
| 15 | 15 | $table->engine = 'InnoDB'; | 
| 16 | 16 |              $table->increments('id'); | 
| 17 | 17 |              $table->string('key'); | 
| @@ -12,14 +12,14 @@ | ||
| 12 | 12 | */ | 
| 13 | 13 | public function up() | 
| 14 | 14 |      { | 
| 15 | -        Schema::create('translation__translation_translations', function (Blueprint $table) { | |
| 15 | +        Schema::create('translation__translation_translations', function(Blueprint $table) { | |
| 16 | 16 | $table->engine = 'InnoDB'; | 
| 17 | 17 |              $table->increments('id'); | 
| 18 | 18 |              $table->text('value'); | 
| 19 | 19 | |
| 20 | 20 |              $table->integer('translation_id')->unsigned(); | 
| 21 | 21 |              $table->string('locale')->index(); | 
| 22 | - $table->unique(['translation_id', 'locale'], 'translations_trans_id_locale_unique'); | |
| 22 | + $table->unique([ 'translation_id', 'locale' ], 'translations_trans_id_locale_unique'); | |
| 23 | 23 |              $table->foreign('translation_id')->references('id')->on('translation__translations')->onDelete('cascade'); | 
| 24 | 24 | }); | 
| 25 | 25 | } | 
| @@ -8,6 +8,6 @@ | ||
| 8 | 8 | use Translatable; | 
| 9 | 9 | |
| 10 | 10 | protected $table = 'translation__translations'; | 
| 11 | - public $translatedAttributes = ['value']; | |
| 12 | - protected $fillable = ['key', 'value']; | |
| 11 | + public $translatedAttributes = [ 'value' ]; | |
| 12 | + protected $fillable = [ 'key', 'value' ]; | |
| 13 | 13 | } | 
| @@ -5,6 +5,6 @@ | ||
| 5 | 5 | class TranslationTranslation extends Model | 
| 6 | 6 |  { | 
| 7 | 7 | public $timestamps = false; | 
| 8 | - protected $fillable = ['value']; | |
| 8 | + protected $fillable = [ 'value' ]; | |
| 9 | 9 | protected $table = 'translation__translation_translations'; | 
| 10 | 10 | } | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 | public function export() | 
| 27 | 27 |      { | 
| 28 | 28 | $data = $this->formatData(); | 
| 29 | - $keys = array_keys($data[0]); | |
| 29 | + $keys = array_keys($data[ 0 ]); | |
| 30 | 30 | |
| 31 | 31 | $csv = Writer::createFromFileObject(new SplTempFileObject()); | 
| 32 | 32 | $csv->insertOne($keys); | 
| @@ -50,9 +50,9 @@ discard block | ||
| 50 | 50 | $translations = $this->translations->getFileAndDatabaseMergedTranslations(); | 
| 51 | 51 | $translations = $translations->all(); | 
| 52 | 52 | |
| 53 | - $data = []; | |
| 53 | + $data = [ ]; | |
| 54 | 54 |          foreach ($translations as $key => $translation) { | 
| 55 | - $data[] = array_merge(['key' => $key], $translation); | |
| 55 | + $data[ ] = array_merge([ 'key' => $key ], $translation); | |
| 56 | 56 | } | 
| 57 | 57 | |
| 58 | 58 | return $data; | 
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | public function rules() | 
| 8 | 8 |      { | 
| 9 | 9 | return [ | 
| 10 | - 'file' => ['required', 'extensions:csv'], | |
| 10 | + 'file' => [ 'required', 'extensions:csv' ], | |
| 11 | 11 | ]; | 
| 12 | 12 | } | 
| 13 | 13 | |
| @@ -8,4 +8,4 @@ | ||
| 8 | 8 | 'as' => 'api.translation.translations.update' | 
| 9 | 9 | ]); | 
| 10 | 10 | |
| 11 | -post('translation/clearCache', ['uses' => 'TranslationController@clearCache', 'as' => 'api.translation.translations.clearCache']); | |
| 11 | +post('translation/clearCache', [ 'uses' => 'TranslationController@clearCache', 'as' => 'api.translation.translations.clearCache' ]); | |
| @@ -4,11 +4,11 @@ | ||
| 4 | 4 | |
| 5 | 5 | /** @var Router $router */ | 
| 6 | 6 | |
| 7 | -$router->group(['prefix' =>'/translation'], function (Router $router) { | |
| 8 | -    $router->bind('translations', function ($id) { | |
| 7 | +$router->group([ 'prefix' =>'/translation' ], function(Router $router) { | |
| 8 | +    $router->bind('translations', function($id) { | |
| 9 | 9 | return app(\Modules\Translation\Repositories\TranslationRepository::class)->find($id); | 
| 10 | 10 | }); | 
| 11 | -    get('translations', ['uses' => 'TranslationController@index', 'as' => 'admin.translation.translation.index', ]); | |
| 12 | -    get('translations/export', ['uses' => 'TranslationController@export', 'as' => 'admin.translation.translation.export', ]); | |
| 13 | -    post('translations/import', ['uses' => 'TranslationController@import', 'as' => 'admin.translation.translation.import', ]); | |
| 11 | +    get('translations', [ 'uses' => 'TranslationController@index', 'as' => 'admin.translation.translation.index', ]); | |
| 12 | +    get('translations/export', [ 'uses' => 'TranslationController@export', 'as' => 'admin.translation.translation.export', ]); | |
| 13 | +    post('translations/import', [ 'uses' => 'TranslationController@import', 'as' => 'admin.translation.translation.import', ]); | |
| 14 | 14 | }); |