Skip to content

Commit

Permalink
Fixed duplicated variables
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Oct 7, 2024
1 parent aa537ca commit fe72f69
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions database/seeders/AirQualityProjectSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function run(): void {
];

foreach ($problems as $problem) {
$problem = CrowdSourcingProjectProblem::updateOrCreate(['project_id' => $problem['project_id'], 'slug' => $problem['slug']], [
$problemRecord = CrowdSourcingProjectProblem::updateOrCreate(['project_id' => $problem['project_id'], 'slug' => $problem['slug']], [
'project_id' => $problem['project_id'],
'slug' => $problem['slug'],
'status_id' => $problem['status_id'],
Expand All @@ -271,11 +271,11 @@ public function run(): void {
foreach ($problem['translations'] as $translation) {
CrowdSourcingProjectProblemTranslation::updateOrCreate(
[
'problem_id' => $problem->id,
'problem_id' => $problemRecord->id,
'language_id' => $translation['language_id'],
],
[
'problem_id' => $problem->id,
'problem_id' => $problemRecord->id,
'language_id' => $translation['language_id'],
'title' => $translation['title'],
'description' => $translation['description'],
Expand All @@ -289,9 +289,9 @@ public function run(): void {
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,
$solutionRecord = CrowdSourcingProjectProblemSolution::updateOrCreate(
['problem_id' => $problemRecord->id, 'slug' => $solution['slug']], [
'problem_id' => $problemRecord->id,
'user_creator_id' => $solution['user_creator_id'],
'slug' => $solution['slug'],
'status_id' => $solution['status_id'],
Expand All @@ -304,11 +304,11 @@ public function run(): void {
}
CrowdSourcingProjectProblemSolutionTranslation::updateOrCreate(
[
'solution_id' => $solution->id,
'solution_id' => $solutionRecord->id,
'language_id' => $translation['language_id'],
],
[
'solution_id' => $solution->id,
'solution_id' => $solutionRecord->id,
'language_id' => $translation['language_id'],
'title' => $translation['title'],
'description' => $translation['description'],
Expand Down

0 comments on commit fe72f69

Please sign in to comment.