Skip to content

Commit

Permalink
Duplicate UAT
Browse files Browse the repository at this point in the history
  • Loading branch information
alexPopaCode4 committed Jan 9, 2025
1 parent 5ca215e commit 7d8114f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/Models/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,27 @@ public function scopeSearch(Builder $query, string $search): Builder
->orWhereHas('parent', function (Builder $query) use ($search) {
$query->where('name', 'like', "%{$search}%");
});
});
})
->whereNot('level', 2);
}

public function getParentNameAttribute(): ?string
{
if (
\in_array($this->type, [11, 19, 22, 23]) &&
$this->parent_id !== null
) {
return $this->parent->name;
$parentName = $this->parent->name;

return $this->parent->type === 3 ? \sprintf('%s %s', __('general.labels.commune'), $parentName) : $parentName;
}

return null;
}

public function getNameWithUatAttribute(): ?string
{
return $this->parent_name ? \sprintf('%s (%s)', $this->name, $this->parent_name) : $this->name;
$name = $this->type == 22 ? \sprintf('%s - %s', $this->name, __('general.labels.village')) : $this->name;

return $this->parent_name ? \sprintf('%s (%s)', $name, $this->parent_name) : $name;
}
}
2 changes: 2 additions & 0 deletions lang/ro/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

'labels' => [
'developed_by' => 'o solutie dezvoltată de',
'village' => 'sat',
'commune' => 'Comuna',
],

'placeholders' => [
Expand Down

0 comments on commit 7d8114f

Please sign in to comment.