Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dietercoopman committed Oct 26, 2023
2 parents 7cdc645 + 1a46e64 commit 1e47b3c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fix-php-code-style-issues.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.2.0
uses: aglipanci/laravel-pint-action@2.3.0

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
2 changes: 2 additions & 0 deletions README.md
@@ -1,3 +1,5 @@
![Translations-export-import](https://banners.beyondco.de/translations-export-import.png?theme=light&packageManager=composer+require&packageName=delta-solutions%2Ftranslations-export-import&pattern=architect&style=style_1&description=Export+and+import+your+spatie%2Flaravel-translation-loader+powered+translations+to+and+from+Excel&md=1&showWatermark=0&fontSize=100px&images=document-download&widths=auto)

[![Latest Version on Packagist](https://img.shields.io/packagist/v/delta-solutions/translations-export-import.svg?style=flat-square)](https://packagist.org/packages/delta-solutions/translations)
[![Total Downloads](https://img.shields.io/packagist/dt/delta-solutions/translations-export-import.svg?style=flat-square)](https://packagist.org/packages/delta-solutions/translations)

Expand Down
6 changes: 3 additions & 3 deletions src/Imports/Translations.php
Expand Up @@ -22,17 +22,17 @@ public function model(array $row): ?LanguageLine
$row['text'] = [];

//get the difference between the columns in the database and the columns in the excel file
$fields = Schema::getColumnListing('language_lines');
$fields = Schema::getColumnListing('language_lines');
$textFields = array_diff(array_keys($row), $fields);

//only get the text fields from the row
$valuesToExtract = array_intersect_key($row, array_flip($textFields));
//filter out empty values
$filteredArray = array_filter($valuesToExtract, function ($value) {
return !blank($value);
return ! blank($value);
});
//set the text field to the filtered array
$row['text'] = $filteredArray;
$row['text'] = $filteredArray;
$row['updated_at'] = Carbon::now();
//remove the text fields from the row
$row = array_diff_key($row, array_flip($textFields));
Expand Down

0 comments on commit 1e47b3c

Please sign in to comment.