Skip to content

Commit

Permalink
Merge pull request #91 from scify/master
Browse files Browse the repository at this point in the history
Logs
  • Loading branch information
PavlosIsaris authored Oct 7, 2024
2 parents 0face42 + aa537ca commit ee9cd63
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions database/seeders/AirQualityProjectSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ public function run(): void {

if (isset($problem['solutions'])) {
foreach ($problem['solutions'] as $solution) {
if (app()->environment() !== 'testing') {
echo "\nAdding Solution: " . $solution['title'] . ' for Problem: ' . $problem['slug'] . "\n";
}
$solution = CrowdSourcingProjectProblemSolution::updateOrCreate(
['problem_id' => $problem->id, 'slug' => $solution['slug']], [
'problem_id' => $problem->id,
Expand All @@ -296,13 +299,16 @@ public function run(): void {
]);
if (isset($solution['translations'])) {
foreach ($solution['translations'] as $translation) {
if (app()->environment() !== 'testing') {
echo "\nAdding Solution Translation: " . $translation['title'] . ' for Solution: ' . $solution['slug'] . "\n";
}
CrowdSourcingProjectProblemSolutionTranslation::updateOrCreate(
[
'solution_id' => $solution['id'],
'solution_id' => $solution->id,
'language_id' => $translation['language_id'],
],
[
'solution_id' => $solution['id'],
'solution_id' => $solution->id,
'language_id' => $translation['language_id'],
'title' => $translation['title'],
'description' => $translation['description'],
Expand Down

0 comments on commit ee9cd63

Please sign in to comment.